- Automation Strategies
- Cluster Automation Strategies
- Proactive Policies
- Cluster Proactive Policies
- Static Policies
- Multi-Policy Container Rightsizing
- Cluster Compaction Policies
- Rollback Policies
Configuration Model
The controller separates automation into two concerns:- Strategy defines how resizing is allowed to happen.
- Policy defines where that behavior applies and whether targets come from recommendations or fixed resource values.
AutomationStrategyandClusterAutomationStrategydefine resize behavior.ProactivePolicyandClusterProactivePolicyapply recommendation-driven automation coming from Kubex.StaticPolicyandClusterStaticPolicyapply fixed request and limit values.ClusterCompactionPolicyapplies active bin-packing and descheduler/scheduler compaction behavior across namespaces.PodAffinityPolicyapplies preferred hostname-based node affinity to replacement pods and can force eviction-based rescheduling when its affinity rule must be enforced during evaluation.ContainerArgsPolicyapplies named command-line argument operations to selected workload containers during pod admission and can optionally converge existing pods through eviction.RollbackPolicyandClusterRollbackPolicyenable and configure rollback monitoring and backoff settings. These policies are required for rollback functionality - without a matching policy, workloads will not be monitored for health failures and rollback will not occur.
ProactivePolicyreferences a namespacedAutomationStrategyin the same namespace.StaticPolicyreferences a namespacedAutomationStrategyin the same namespace and also includes explicitresources.ClusterProactivePolicyreferences aClusterAutomationStrategy.ClusterStaticPolicyreferences aClusterAutomationStrategyand also includes explicitresources.ClusterCompactionPolicymanages compaction implementation mode and scope for active bin-packing, including per-policy descheduler placement and node selectors.
kubectl.
Helm-Managed Mapping
The chart’sscope and policy.policies values provide a convenience layer for creating a cluster-scoped recommendation-driven setup.
When policy.policies is populated, the chart renders one ClusterAutomationStrategy per policy entry.
When scope is populated, the chart renders one ClusterProactivePolicy per scope entry.
This Helm-managed flow creates only these CR types:
ClusterAutomationStrategyClusterProactivePolicy
AutomationStrategyProactivePolicyStaticPolicyClusterStaticPolicyRollbackPolicyClusterRollbackPolicyContainerArgsPolicy
Values To Resource Mapping
Namespace wildcards in scope[].namespaces.values
scope[].namespaces.values supports shell-style * wildcards when matching namespace names (for example: prod-*).
- Wildcard patterns must be enclosed in double quotes (e.g.,
"prod-*", notprod-*) to ensure proper YAML parsing. maxAnalysisAgeDaysis written to generatedClusterProactivePolicyresources, not to generated strategies.ReplicaSetis not supported inallowedPodOwners; useDeploymentto cover Deployment-managed pods.StrimziPodSetsupport is opt-in inallowedPodOwners.Modelis included in default workload types when policyworkloadTypesis omitted. KeepallowedPodOwners: [Model]when you want Helm-generated scope restricted to KubeAIModelobjects only.- Helm can reference a
ClusterAutomationStrategythat was created outside Helm if the names match.
Strategy Settings Exposed By Helm
For eachpolicy.policies.<name> entry, Helm can populate these ClusterAutomationStrategy settings:
enablement.cpu.requests.*enablement.cpu.limits.*enablement.memory.requests.*enablement.memory.limits.*inPlaceResize.*podEviction.*safetyChecks.*exceptmaxAnalysisAgeDays, which is written toClusterProactivePolicy
spec.scheduling.inclusionWindows and spec.scheduling.exclusionWindows.
For the full strategy CRD surface, including scheduling, manage ClusterAutomationStrategy directly with manifests.
See Cluster Automation Strategies and Cluster Proactive Policies for the cluster-scoped CRD field references and examples.
When To Manage CRs Outside Helm
Manage CRs outside Helm when you need:- namespaced strategies or policies
- fixed-resource policies
- cluster proactive policies that are not tied to chart values
- cluster automation strategies that are shared, versioned, or promoted independently of Helm releases
- advanced strategy safety checks beyond the Helm-managed subset
- scheduling windows that restrict when automation can run
ClusterAutomationStrategy and ClusterProactivePolicy are not Helm-only resource types.
PodAffinityPolicy Behavior
PodAffinityPolicy is a cluster-scoped CR that is supported by the controller but managed outside Helm today.
Use it when you want replacement pods to prefer a specific set of node hostnames via spec.affinity.nodes.
Behavior summary:
- Admission always injects preferred
kubernetes.io/hostname In [...]node affinity into newly created replacement pods. - During policy evaluation, eviction is enabled whenever the managed preferred hostname affinity on the pod would need to change.
spec.affinity.checkCurrentNodeSatisfiesAffinitydefaults tofalse.- When
spec.affinity.checkCurrentNodeSatisfiesAffinityistrue, policy evaluation also checks the current node hostname. If the running pod is on a node whosekubernetes.io/hostnamelabel is not inspec.affinity.nodes, eviction is enabled even when the pod already has the intended managed affinity.
- Enabling
spec.affinity.checkCurrentNodeSatisfiesAffinitycan cause eviction loops if the workload cannot actually land on one of the intended nodes. This can happen when scheduler constraints, taints, missing tolerations, topology rules, resource pressure, or other placement rules keep replacement pods off the target nodes. - Prefer enabling this setting only when you know the target nodes are schedulable for the workload and the preferred hostname list is stable.
ContainerArgsPolicy Behavior
ContainerArgsPolicy is a cluster-scoped CR managed outside Helm or through proposal sync. It targets workload kinds, namespaces, and labels through spec.scope, then writes one runtime-hook recommendation to matching workloads.
operationdefaults toAddOrUpdate;Removedeletes every matching equals or split-form occurrence.- Omitted
valueemits a valueless flag.value: ""emits an explicit empty value. - Existing
--option=value,--option value, and-o valueforms are replaced in place when possible. Missing valued options append in split form. - Duplicate existing options are collapsed. Duplicate policy entries remain in declared order.
- Wildcard rules apply to all regular containers and restartable sidecars. A named container rule overrides wildcard entries with the same option name; missing named containers are skipped.
- Option names must be literal names beginning with
-or--, with no whitespace or=. Combined short flags, attached short values, shell strings, positional edits, andcommandedits are unsupported. - Malformed existing argument streams use best-effort replacement; unrelated arguments keep their order.
- This API does not parse shell strings, edit
commandor positional arguments, detect executables/vLLM, merge policies, patch workload templates, or evict pods directly.
ContainerArgsPolicy is selected using PolicyEvaluation type priority, policy weight, and existing deterministic tie-breaking. Policies do not merge across resources.
replaceExistingPods defaults to false, so admission mutation affects new pods only. Set it to true to let PolicyEvaluation request eviction when effective managed arguments drift; the controller does not patch workload templates or evict pods directly. This can disrupt workloads and should be enabled only with deliberate disruption controls.
When a selected ContainerArgsPolicy hook has no resolved AutomationStrategy, PolicyEvaluation implicitly enables eviction and retries PodDisruptionBudget-blocked evictions. It requeues those retries every 30 seconds. A resolved strategy’s podEviction and safetyChecks.resizeRetryInterval settings remain authoritative.
KAI vLLM tuning runs after runtime hooks and changes --gpu-memory-utilization. Conflicting KAI and ContainerArgsPolicy values may cause repeated replacement requests.
Proposal sync supports ContainerArgsPolicy as a cluster-scoped proposal kind. Proposal metadata must omit namespace. Helm does not create policy instances or expose a values mapping for this API.
Scope Design Guidance
- Prefer mutually exclusive scopes when multi-policy rightsizing is disabled. When enabled, overlapping same-kind resource policies can contribute to separate container/resource targets. See Multi-Policy Container Rightsizing.
- Use
weightwhen policies can recommend the same target. - Enable
globalConfiguration.multiPolicyContainerRightsizingEnabledwhen same-kind policies need to contribute independently. By default, one policy of each kind contributes per workload. - Start with narrow namespace and label selectors before widening scope.
- Exclude system and platform namespaces from broad proactive automation.
- Use static policies when exact requests and limits matter more than recommendation-driven tuning.
Precedence And Overlap
With the default fixed-key behavior, one resource policy of each kind contributes per workload. WhenglobalConfiguration.multiPolicyContainerRightsizingEnabled is true, same-kind policies can contribute independently and PolicyEvaluation selects a candidate for each container, request or limit, and resource. It ranks candidates by policy-type priority, weight, exact container target over "*", older creation time for equal-ranked policies of the same kind, then the lexically smaller annotation key. See Multi-Policy Container Rightsizing.
ContainerArgsPolicy remains a single selected runtime hook; its policies do not merge.
Policy Type Precedence
By default, static policies (fixed resources) take precedence over proactive policies (recommendations). This is controlled by thePolicyEvaluation singleton resource. ContainerArgsPolicy has default priority 100 so overlapping argument-hook policies are selected predictably; its weight resolves overlap between instances.
Default precedence:
ContainerArgsPolicy: priority 100StaticPolicyandClusterStaticPolicy: priority 90ProactivePolicyandClusterProactivePolicy: priority 70
policy-evaluation resource:
- Start from the default
PolicyEvaluationexample in Policy Evaluation. - Change the priorities so proactive policy types win:
- Set
ProactivePolicyandClusterProactivePolicytopriority: 90 - Set
StaticPolicyandClusterStaticPolicytopriority: 70
- Set
rightsizing summary logs.
