Docs
Wave Sizing
CRDs

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.0

Spec fields

FieldTypeRequiredDefaultDescription
targetRefobjectYesn/aWorkload to manage.
targetRef.kindstringYesn/aDeployment, Rollout (Argo Rollouts), DeploymentConfig (OpenShift), DaemonSet, or StatefulSet.
targetRef.namestringYesn/aName of the workload in the same namespace as the CR.
applyModestring (enum)Nooffoff / in_place / manifest. Must be quoted when set to "off" in YAML (bare off is a YAML 1.1 boolean). See Notes.
aggressivebooleanNofalseUse the last 1 hour of usage data instead of the 7+ day histogram. Trades stability of the recommendation for freshness. See Aggressive Recommendations.
containersmapNo{}Per-container sizing settings, keyed by container name. See container fields below. Omitted → empty map (no per-container settings).
containers.<name>.enabledbooleanYesn/aWhether Smart Sizing is active for this container.
containers.<name>.applyAutobooleanYesn/aOpt 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>.applyLimitCpubooleanNofalseWhen auto-applying, also apply the CPU limit. Requests are always applied when auto-apply is on; limits only if explicitly enabled.
containers.<name>.applyLimitMemorybooleanNofalseWhen 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>.cpuEnabledbooleanNofalseEnable CPU recommendation for this container. Omitting disables CPU sizing for this container.
containers.<name>.cpuMinnumberNon/aCPU request floor in cores. The recommendation never goes below this value.
containers.<name>.cpuMaxnumberNon/aCPU request ceiling in cores. The recommendation never exceeds this value.
containers.<name>.cpuBufferPercentagenumberNo10Safety margin (%) added on top of observed CPU usage before min/max clamping. Omitted → 10%.
containers.<name>.memoryEnabledbooleanNofalseEnable memory recommendation for this container. Omitting disables memory sizing for this container.
containers.<name>.memoryMinnumberNon/aMemory request floor in MiB (the console labels this field MB; same number).
containers.<name>.memoryMaxnumberNon/aMemory request ceiling in MiB (the console labels this field MB; same number).
containers.<name>.memoryBufferPercentagenumberNo10Safety 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.kind must be one of Deployment, Rollout (Argo Rollouts), DeploymentConfig (OpenShift), DaemonSet, or StatefulSet.
  • applyMode values are snake_case: in_place / manifest / off. Omitting the field is equivalent to off; 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; bare off is parsed as a boolean false by YAML 1.1 parsers (including kubectl) and fails the string-enum validation.
  • Both switches must be on for auto-apply. The workload-level applyMode and the container-level applyAuto must both be enabled. If applyMode is off, no container is ever auto-applied regardless of its applyAuto flag.
  • Buffer default is 10%. Omitting cpuBufferPercentage or memoryBufferPercentage causes Wave to default to 10% for that resource. This matches the Container Settings default.
  • applyLimitCpu and applyLimitMemory default to off. Requests are always applied when applyAuto is true. 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 in manifest mode; the in-place resize path does not change memory limits, so applyLimitMemory has no effect under in_place.
  • System guardrails override your bounds. Regardless of cpuMin/memoryMin, recommendations never go below 0.1 CPU core (0.01 core when aggressive: true) or the 12 MiB container-runtime memory minimum, and limit ≥ request is always enforced. See guardrails.
  • TargetNotFound self-heals. A CR whose target workload does not exist yet succeeds at kubectl apply time. Wave reports TargetNotFound in .status.conditions and reconciles automatically when the workload appears. Apply order does not matter.