v0.17.0 and HAMi-core 1.1.0-chart.
[!IMPORTANT]
GPU/KAI fields and related custom resources are experimental and subject to breaking changes. Set spec.experimental.gpuKaiContract: v1alpha1-2026-07 on GPU/KAI resources.
Prerequisites
- KAI is already installed in the cluster. KAI installation instructions
- Kubex has been tested with KAI version v0.17.0.
kubex-crds,kubex-automation-engine, andkubex-automation-stackare already installed.- The
kubex-automation-enginerelease must enablewebhook.podMutation.additionalWebhook.enabledas shown below. - When using
ClusterGpuReactivePolicyorGpuReactivePolicy, Prometheus must be available for GPU metrics, typically viakubex-automation-stack. - If Prometheus runs at a different endpoint, set
globalConfiguration.prometheus.urlto the custom URL.
- The
- A new KAI installation.
- An existing KAI installation.
gpu-fraction annotation without replacing the existing kai.scheduler/queue label.
Required Kubex webhook values
KAI relies on resource information updated by Kubex when making admission decisions. Before deploying the KAI-managed workloads described in this guide, configure thekubex-automation-engine Helm release with the additional webhook enabled:
New KAI installation
Depending on your cloud provider and NVIDIA configuration, you may need to adjust KAI’s configuration. The following example shows a minimal KAI installation tested with the NVIDIA GPU Operator already running in the Kubernetes cluster. It also installs HAMi-core to enforce GPU memory limits for CUDA workloads. Thekai-resource-isolator chart deploys HAMi-core’s GPU library synchronization components on selected GPU nodes.
HAMi-core is optional but preferred: it enforces KAI fractions, while Kubex’s GPU Reactive Policies can only increase fractions on a best-effort basis as pods approach their limits.
Create kai-resource-isolator.values.yaml:
kai-scheduler.values.yaml:
Verify HAMi-core
If HAMi-core is used, verify that GPU nodes run pods from the following DaemonSet:DESIRED, CURRENT, and READY counts should cover all eligible GPU nodes. If HAMi-core is unavailable or you do not want to use it, use GpuReactivePolicy or ClusterGpuReactivePolicy to monitor GPU memory utilization through Prometheus and upsize workloads when utilization crosses configured thresholds. Reactive policies resize GPU allocations; they do not enforce memory limits. Prefer HAMi-core when possible so memory is enforced instead of upsizing pods to accommodate higher usage. See GPU Reactive Policies.
Prometheus notes
By default, thekubex-automation-engine chart configures GPU reactive policies to query Prometheus at http://kubex-prometheus-server.kubex.svc.
This matches the default Prometheus service name used by kubex-automation-stack.
If your Prometheus endpoint is different, override the controller-wide setting through the Helm value globalConfiguration.prometheus.url.
Built-in KAI queues
If you want Kubex Automation Engine to create the built-in KAI queue resources used in this guide, enable them in your Helm values:kubex-unlimited-gpu-queue.
Starter Example
This example creates the following resources:- A
ClusterAutomationStrategyfor KAI-enabled workloads across the cluster - A
ClusterProactivePolicythat makes matchingDeploymentworkloads managed by that strategy - A
ClusterGpuReactivePolicythat adjusts the shared GPU request based on Prometheus GPU metrics
Deployment workloads in all namespaces that carry nvidia.com/gpu.present: "true".
Model owner, then propagates effects to model-owned pods.
Automation Strategy Notes
GPU metric interpretation defaults tofullGPU, which means Prometheus values are treated as percentages of one whole GPU. Set prometheus.interpretation: currentAllocation when a metric reports utilization relative to the container’s current GPU allocation, such as KAI GPU memory utilization.
Every strategy using overrideScheduler: "kai" should set spec.enablement.gpu.requests.ceiling: "1". The controller clamps larger recommendations to that ceiling before writing gpu-fraction.
For KAI-enabled workloads, start with spec.inPlaceResize.enabled: false.
- Eviction-based resize is the safer path today for KAI-enabled workloads.
- In-place resizing for KAI-enabled workloads is experimental and currently unstable.
vLLM tuning with KAI gpu-fraction
If a pod runs vLLM, setspec.kai.vllm.gpuMemoryUtilizationBufferPercent to leave a safety buffer below its KAI GPU allocation. A value of 10 leaves 10% of the allocation unused by vLLM. This setting works whether or not HAMi-core is enabled.
Kubex applies the setting to vLLM containers when it assigns a KAI GPU allocation. It updates an existing --gpu-memory-utilization argument or adds it when needed.
Existing KAI Installations
For workloads that are already scheduled through KAI, these policies will:- Keep the existing
kai.scheduler/queuelabel on the workload template. - Allow Kubex Automation Engine to update
gpu-fractionas policies are applied.
kai.scheduler/queue label, set spec.kai.setQueueWhenSpecified: true in your AutomationStrategy.
For workloads that are not currently scheduled through KAI, these policies will:
- Replace the
nvidia.com/gpuresource allocation with KAIgpu-fractionannotations. - Apply the KAI queue
kubex-unlimited-gpu-queue(the Kubex-built-in KAI queue that does not perform quota allocations).
KAI node consolidation
GpuConsolidationPolicy is cluster-scoped and works separately from AutomationStrategy. Use it to identify underutilized GPU nodes within a single compatible node pool and evict pods from a node only when the controller believes all gpu-fraction pods on that node can fit elsewhere in the same pool.
Start with one narrowly scoped policy per compatibility pool:
nvidia-tesla-t4 nodes separate from nvidia-l4 nodes or from a different provider-specific GPU node class.
Node consolidation limitations
GPU node consolidation is experimental and has known limitations.- It assumes pods will be schedulable on other nodes if they fit by GPU fraction.
- It does not yet fully model all other scheduler constraints.
- That can lead to frequent evictions when the controller chooses a node that looks drainable from GPU capacity alone but cannot actually be rescheduled cleanly.
- It may behave unpredictably with nodes that have multiple GPUs.

