Configure Karpenter GPU nodes
Install GPU Operator and configure a dedicated Karpenter GPU NodePool to run GPU workloads.
The Karpenter Provider for Kubernetes Engine supports Virtual Machine-based NVIDIA T4 (gn1i) and NVIDIA A100 (p2i) instances. Karpenter creates GPU instances and joins them to the cluster, but does not configure the NVIDIA runtime in containerd or the NVIDIA device plugin.
GPU Operator accesses the host file system, changes containerd settings, and may restart containerd on GPU nodes during installation. Complete installation and validation before deploying production workloads, as existing GPU workloads may be affected.
If you use Pod Security Admission, the gpu-operator namespace requires the privileged policy.
Prerequisites
Check the following items.
- Install Karpenter as described in Install Karpenter and configure nodes.
- The
Readycondition of the KCNodeClass to use must beTrue. - Check GPU instance quotas and available subnet IP addresses.
- Prepare a container image registry accessible from GPU nodes.
Check whether GPU Operator is already installed.
helm list -A | grep -E '(^|[[:space:]])gpu-operator([[:space:]]|$)' || true
If GPU Operator is listed, retain the existing installation and go to Step 2. Create GPU NodePool. Do not change the existing Operator version or settings.
If GPU Operator is absent but you use a separate NVIDIA device plugin on Kubernetes Engine managed GPU nodes, review the impact on existing GPU nodes before installing the Operator. For this configuration, contact Helpdesk > Technical inquiry to verify the configuration before proceeding.
Step 1. Install GPU Operator
If GPU Operator is not installed, first check whether Node Feature Discovery (NFD) is installed.
kubectl get daemonset -A \
| grep -E 'node-feature-discovery|nfd-worker' || true
If NFD is already installed, add --set nfd.enabled=false to the Helm command below to prevent duplicate installation.
Install GPU Operator. Kubernetes Engine GPU worker images include the NVIDIA driver, so set driver.enabled=false.
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
kubectl create namespace gpu-operator --dry-run=client -o yaml \
| kubectl apply -f -
kubectl label namespace gpu-operator --overwrite \
pod-security.kubernetes.io/enforce=privileged
helm upgrade --install gpu-operator nvidia/gpu-operator \
--namespace gpu-operator \
--version v26.3.2 \
--set driver.enabled=false \
--set toolkit.enabled=true \
--set devicePlugin.enabled=true \
--wait \
--timeout 15m
Verify that GPU Operator and its operand Pods are running normally.
kubectl -n gpu-operator get pods
kubectl -n gpu-operator get daemonset
For installation options, see the NVIDIA GPU Operator installation guide.
Step 2. Create GPU NodePool
Create a dedicated GPU NodePool. Configure a permanent taint so Pods that do not require GPUs do not trigger GPU node provisioning.
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: karpenter-gpu
spec:
template:
metadata:
labels:
workload-type: karpenter-gpu
kakaoi.io/kke-nodepool: karpenter-gpu
spec:
requirements:
- key: kubernetes.io/os
operator: In
values: ["linux"]
- key: kubernetes.io/arch
operator: In
values: ["amd64"]
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand"]
- key: node.kubernetes.io/instance-type
operator: In
values: ["gn1i.xlarge", "p2i.6xlarge"]
taints:
- key: nvidia.com/gpu
value: "present"
effect: NoSchedule
nodeClassRef:
group: karpenter.kakaocloud.com
kind: KCNodeClass
name: karpenter-default
expireAfter: 720h
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 10m
limits:
cpu: "64"
memory: 256Gi
nvidia.com/gpu: "8"
Specify the nvidia.com/gpu taint in taints, not startupTaints. GPU Operator and the device plugin do not remove this taint.
For clusters using Cilium, also add the Cilium startup taint as described in Install Karpenter and configure nodes > Step 4. Create NodePool.
Create the NodePool and check its status.
kubectl apply -f gpu-nodepool.yaml
kubectl get nodepool karpenter-gpu
Verify that READY is True.
Step 3. Run GPU workload
Create a test Pod that requests GPU resources, tolerates the taint, and selects the GPU NodePool using nodeSelector.
apiVersion: v1
kind: Pod
metadata:
name: gpu-smoke
spec:
restartPolicy: Never
nodeSelector:
workload-type: karpenter-gpu
tolerations:
- key: nvidia.com/gpu
operator: Equal
value: "present"
effect: NoSchedule
containers:
- name: cuda
image: nvcr.io/nvidia/k8s/cuda-sample:vectoradd-cuda12.5.0-ubuntu22.04
resources:
limits:
nvidia.com/gpu: 1
Creating the Pod causes Karpenter to provision a GPU node.
kubectl apply -f gpu-smoke.yaml
kubectl get nodeclaims
kubectl get nodes -l karpenter.sh/nodepool=karpenter-gpu
kubectl get pod gpu-smoke -o wide
Verify that the new node is Ready and GPU Operator operand Pods are Running on that node.
kubectl get nodes -l karpenter.sh/nodepool=karpenter-gpu \
-o custom-columns='NODE:.metadata.name,CAPACITY:.status.capacity.nvidia\.com/gpu,ALLOCATABLE:.status.allocatable.nvidia\.com/gpu'
kubectl logs gpu-smoke
If both CAPACITY and ALLOCATABLE are greater than 0 and the Pod logs show Test PASSED, the GPU is available. If the GPU values are empty or 0 even though the node is Ready, check the GPU runtime and device plugin configuration.
Delete the test Pod after verification.
kubectl delete -f gpu-smoke.yaml
After consolidateAfter elapses, verify that the GPU node and instance are reclaimed. GPU instances incur charges whether or not Pods are running, so also verify instance deletion in the KakaoCloud Console.