Administer Kubernetes environments: Worked Example — Administration (NVIDIA-Certified Professional: AI Operations)
{ "title": "NVIDIA-Certified Professional: AI Operations – Administer Kubernetes Environments: Worked Example", "category": "NVIDIA-Certified...
{ "title": "NVIDIA-Certified Professional: AI Operations – Administer Kubernetes Environments: Worked Example", "category": "NVIDIA-Certified Professional: AI Operations", "hashtags": "NVIDIA, AIOperations, Kubernetes, MIG, RunAI", "content": "
Administering Kubernetes Environments: A Worked Example for NVIDIA-Certified Professional: AI Operations
In the NVIDIA-Certified Professional: AI Operations exam, administration of Kubernetes environments is a critical skill. This worked example demonstrates the step-by-step process to administer a Kubernetes cluster optimized for AI workloads, focusing on GPU resource management, including Multi-Instance GPU (MIG) configuration, and integration with Run:AI platform.
Scenario
You are tasked with deploying and managing an AI workload on a Kubernetes cluster equipped with NVIDIA GPUs. The cluster must efficiently allocate GPU resources using MIG, ensure proper scheduling of AI jobs, and integrate with Run:AI for workload orchestration.
Step 1: Verify Kubernetes Cluster and NVIDIA GPU Setup
- Ensure the Kubernetes cluster is up and running with nodes that have NVIDIA GPUs installed.
- Install the NVIDIA device plugin for Kubernetes to expose GPUs to the cluster. This plugin enables Kubernetes to schedule GPU resources.
Command example:
kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.11.0/nvidia-device-plugin.yml
Step 2: Configure Multi-Instance GPU (MIG)
To maximize GPU utilization, configure MIG on supported NVIDIA GPUs (e.g., A100). MIG partitions a single GPU into multiple isolated instances.
- Enable MIG mode on each GPU node by running:
sudo nvidia-smi -i GPU_ID -mig 1
- Create MIG instances as needed. For example, to create a 1g.5gb instance:
sudo nvidia-smi mig -cgi 19,19,19 -C
- Restart the NVIDIA device plugin to detect MIG instances as separate resources.
Step 3: Label Nodes for GPU and MIG Resources
Label each node to indicate available GPU and MIG resources for Kubernetes scheduling.
kubectl label nodes NODE_NAME nvidia.com/gpu.present=true
For MIG, custom labels or extended resources can be used to represent MIG instances.
Step 4: Deploy AI Workload with GPU and MIG Resource Requests
Create a Kubernetes pod specification that requests GPU resources. For MIG, specify the exact MIG resource profile if supported.
apiVersion: v1 kind: Pod metadata: name: ai-workload spec: containers: - name: ai-container image: ai-image:latest resources: limits: nvidia.com/gpu: 1 # Request one GPU or MIG instance
Step 5: Integrate with Run:AI Platform
Run:AI provides advanced scheduling and resource orchestration for AI workloads.
- Install Run:AI agents on the Kubernetes cluster.
- Configure Run:AI to recognize GPU and MIG resources.
- Submit AI jobs through Run:AI CLI or UI, which schedules jobs considering GPU availability and priorities.
Step 6: Monitor and Troubleshoot
- Use kubectl commands to monitor pod status and GPU allocation.
- Use nvidia-smi on nodes to verify MIG instance usage.
- Check Run:AI dashboard for job queue and resource utilization.
Worked Example Summary
Problem: Deploy an AI training job on a Kubernetes cluster with NVIDIA A100 GPUs using MIG and Run:AI.
Solution steps:
- Verify Kubernetes and GPU setup; install NVIDIA device plugin.
- Enable MIG mode and create MIG instances on GPU nodes.
- Label nodes to reflect GPU/MIG resources.
- Create pod spec requesting GPU/MIG resources.
- Deploy Run:AI agents and submit jobs via Run:AI.
- Monitor GPU usage and job status with kubectl, nvidia-smi, and Run:AI tools.
This approach ensures efficient GPU utilization, workload orchestration, and scalability for AI operations in Kubernetes environments.
" }
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →