Wave Sizing CRDs
This kind configures Smart Sizing in CRD Mode. For per-container bounds and buffer semantics, see Container Settings; for auto-apply modes and prerequisites, see Realtime Resizing.
WaveSmartSizingPolicy
WaveSmartSizingPolicy declares Smart Sizing bounds and auto-apply behavior for a single workload: its per-container CPU/memory floors, ceilings, safety buffer, and whether Wave applies recommendations automatically and on which apply mode.
Scope: namespaced, must be created in the same namespace as the target workload.
apiVersion: wavek8s.com/v1alpha1
kind: WaveSmartSizingPolicy
metadata:
name: checkout-api-sizing
namespace: payment
spec:
targetRef:
kind: Deployment
name: checkout-api
# off = recommendations are computed but never auto-applied (default when omitted)
# in_place = apply via the Kubernetes /resize subresource (no pod restart)
# manifest = patch the workload spec (rollout-managed)
applyMode: in_place
# aggressive = use the last 1 hour of data instead of the 7+ day histogram
aggressive: false
containers:
app:
enabled: true
applyAuto: true # opt this container into automatic apply
applyLimitCpu: false # keep the CPU limit where you set it (default)
applyLimitMemory: false # keep the memory limit where you set it (default)
cpuEnabled: true
cpuMin: 0.1 # floor in CPU cores
cpuMax: 2.0 # ceiling in CPU cores
cpuBufferPercentage: 15.0 # safety margin (%) added on top of observed usage
memoryEnabled: true
memoryMin: 256.0 # floor in MiB
memoryMax: 4096.0 # ceiling in MiB
memoryBufferPercentage: 20.0
sidecar:
enabled: true
applyAuto: false # observe only for this container
cpuEnabled: true
cpuMin: 0.1
cpuMax: 0.5
cpuBufferPercentage: 10.0
memoryEnabled: true
memoryMin: 64.0
memoryMax: 512.0
memoryBufferPercentage: 10.0Spec fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
targetRef | object | Yes | n/a | Workload to manage. |
targetRef.kind | string | Yes | n/a | Deployment, Rollout (Argo Rollouts), DeploymentConfig (OpenShift), DaemonSet, or StatefulSet. |
targetRef.name | string | Yes | n/a | Name of the workload in the same namespace as the CR. |
applyMode | string (enum) | No | off | off / in_place / manifest. Must be quoted when set to "off" in YAML (bare off is a YAML 1.1 boolean). See Notes. |
aggressive | boolean | No | false | Use the last 1 hour of usage data instead of the 7+ day histogram. Trades stability of the recommendation for freshness. See Aggressive Recommendations. |
containers | map | No | {} | Per-container sizing settings, keyed by container name. See container fields below. Omitted → empty map (no per-container settings). |
containers.<name>.enabled | boolean | Yes | n/a | Whether Smart Sizing is active for this container. |
containers.<name>.applyAuto | boolean | Yes | n/a | Opt this container into automatic apply. When false, recommendations are generated but never applied; applyAuto must be true and the workload-level applyMode must not be off for anything to be applied automatically. |
containers.<name>.applyLimitCpu | boolean | No | false | When auto-applying, also apply the CPU limit. Requests are always applied when auto-apply is on; limits only if explicitly enabled. |
containers.<name>.applyLimitMemory | boolean | No | false | When auto-applying, also apply the memory limit. Requests are always applied when auto-apply is on; limits only if explicitly enabled. Applied only in manifest mode: the Kubernetes in-place resize path does not change memory limits, so this flag has no effect under in_place. |
containers.<name>.cpuEnabled | boolean | No | false | Enable CPU recommendation for this container. Omitting disables CPU sizing for this container. |
containers.<name>.cpuMin | number | No | n/a | CPU request floor in cores. The recommendation never goes below this value. |
containers.<name>.cpuMax | number | No | n/a | CPU request ceiling in cores. The recommendation never exceeds this value. |
containers.<name>.cpuBufferPercentage | number | No | 10 | Safety margin (%) added on top of observed CPU usage before min/max clamping. Omitted → 10%. |
containers.<name>.memoryEnabled | boolean | No | false | Enable memory recommendation for this container. Omitting disables memory sizing for this container. |
containers.<name>.memoryMin | number | No | n/a | Memory request floor in MiB (the console labels this field MB; same number). |
containers.<name>.memoryMax | number | No | n/a | Memory request ceiling in MiB (the console labels this field MB; same number). |
containers.<name>.memoryBufferPercentage | number | No | 10 | Safety margin (%) added on top of observed memory usage before min/max clamping. Omitted → 10%. |
⚠️
The containers map is whole-replace, not merge. On each apply the stored per-container configuration is replaced by exactly what the CR declares. A container omitted from the map loses its custom settings. Include every container you want configured.
Notes
- Namespaced: create the CR in the target workload's namespace.
targetRef.kindmust be one ofDeployment,Rollout(Argo Rollouts),DeploymentConfig(OpenShift),DaemonSet, orStatefulSet. applyModevalues are snake_case:in_place/manifest/off. Omitting the field is equivalent tooff; recommendations are calculated but nothing is applied automatically without an explicit opt-in. This maps to the three modes described in Realtime Resizing. When writing"off"in YAML, quote it; bareoffis parsed as a booleanfalseby YAML 1.1 parsers (includingkubectl) and fails the string-enum validation.- Both switches must be on for auto-apply. The workload-level
applyModeand the container-levelapplyAutomust both be enabled. IfapplyModeisoff, no container is ever auto-applied regardless of itsapplyAutoflag. - Buffer default is 10%. Omitting
cpuBufferPercentageormemoryBufferPercentagecauses Wave to default to 10% for that resource. This matches the Container Settings default. applyLimitCpuandapplyLimitMemorydefault to off. Requests are always applied whenapplyAutoistrue. Limits are only applied if you explicitly enable these per-container flags; lowering a memory limit automatically is the riskiest sizing action (unexpected spike → OOMKill), so Wave requires a deliberate opt-in. The memory limit is applied only inmanifestmode; the in-place resize path does not change memory limits, soapplyLimitMemoryhas no effect underin_place.- System guardrails override your bounds. Regardless of
cpuMin/memoryMin, recommendations never go below 0.1 CPU core (0.01 core whenaggressive: true) or the 12 MiB container-runtime memory minimum, andlimit ≥ requestis always enforced. See guardrails. TargetNotFoundself-heals. A CR whose target workload does not exist yet succeeds atkubectl applytime. Wave reportsTargetNotFoundin.status.conditionsand reconciles automatically when the workload appears. Apply order does not matter.