Multi-Tenant GPU Kubernetes Architecture with Kamaji and HAMi
The architecture of multi-tenant GPU Kubernetes using Kamaji and HAMi ensures isolation by running tenant control planes as pods in a single management cluster, with shared components limited to the management cluster and kamaji-etcd datastore.
Architecture Overview and Isolation
The architecture of multi-tenant GPU Kubernetes using Kamaji and HAMi is designed to ensure isolation while sharing resources efficiently. In this setup, Kamaji runs each tenant’s Kubernetes control plane as pods within a single management cluster, allowing centralized oversight without compromising tenant separation. The architecture relies on a single kind cluster that hosts Kamaji and the control planes of all tenants. Each tenant’s worker node operates as a separate container, connecting over the kind network and executing HAMi to manage GPU resources. The only shared components are the management cluster and the kamaji-etcd datastore, where tenant data is stored separately to maintain isolation. This design ensures that while resources are shared at the infrastructure level, tenant-specific data and control planes remain distinct, minimizing interference and enhancing security.
GPU Resource Allocation and Simulation
Multi-tenant GPU Kubernetes environments using Kamaji and HAMi allow for the simulation of hardware resources, enabling distinct GPU configurations for different tenants. In one setup, tenant-a is allocated 1 × NVIDIA A100 80 GB (81,920 MB, 100 cores), while tenant-b receives 2 × NVIDIA L4 24 GB (49,152 MB, 200 cores), as described in CNCF. The build process involves five steps, with step 3 creating both tenants simultaneously and steps 4 and 5 repeated per tenant. Each tenant’s GPU resources are annotated with specific details, such as GPU-MOCK-B0 and GPU-MOCK-B1, which have 24,576 MB and 100 cores each, as noted in CNCF. Kamaji provides each team with its own Kubernetes API without requiring a dedicated control plane machine per team, while HAMi manages GPU resources by turning them into pools of slices within those clusters, as stated in CNCF.
Handling Over-Commitment and Lock Contention
Handling over-commitment and lock contention in multi-tenant GPU Kubernetes environments requires careful scheduling and resource management. According to evidence, HAMi actively prevents over-commitment by refusing to schedule a fourth pod that would exceed available resources, as seen in TC-06 and TC-07. A fourth pod requesting 30% of a node’s capacity would require 120 of 100 cores, leading to a Pending status with the message CardInsufficientCore. Additionally, HAMi locks a node during pod binding to prevent race conditions, marking it with hami.io/bind-phase: allocating. If a pod is annotated with hami.io/bind-phase=success, subsequent pods can bind quickly, as demonstrated in CNCF. These mechanisms ensure fair resource allocation and prevent contention in shared GPU environments.
Testing and Validation of Multi-Tenant Setup
Testing and validation of the multi-tenant setup using Kamaji and HAMi demonstrated successful isolation of two tenant clusters, each scheduling fractional-GPU workloads through HAMi, with all eight tests passing, as reported in CNCF. However, challenges were observed during scheduling, as noted in CNCF, where a pod requesting 90,000 MB of GPU memory exceeded the available 81,920 MB, resulting in a CardInsufficientMemory status. Additionally, the gateway lookup from the Kamaji guide revealed an IPv6 and IPv4 gateway address concatenated as fc00:f853:ccd:e793::1172.18.0.1, as described in CNCF.
Integration and Workarounds for Simulated Hardware
Integration of multi-tenant GPU Kubernetes on simulated hardware using Kamaji and HAMi requires careful handling of networking and resource allocation workarounds. For IPv4 subnet configuration, users must manually extract the subnet range via docker network inspect kind | grep Subnet and define it explicitly, such as 172.18.255.200-172.18.255.250, as noted in CNCF. Additionally, the mock plugin’s behavior limits lock expiration to 5 minutes, as described in CNCF. To bypass this, administrators can manually annotate pods with hami.io/bind-phase=success and remove the hami.io/mutex.lock annotation from the node, as outlined in daily.dev. These steps are essential for ensuring compatibility and stability in simulated environments where hardware-level interactions are not fully emulated.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.