This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: k8s-132-dra-gpu-partitioning-guardrail

Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail

Enforces Kubernetes 1.32 Dynamic Resource Allocation (DRA) structured parameters to partition co-located distributed LLM inference micro-slices into hardware-isolated compute and memory domains. Prevents unthrottled tensor engine bus contention, L2 cache thrashing, and kernel watchdog timeouts caused by unmanaged multi-tenant GPU overcommit. Mandates explicit DeviceClass configurations, Structured Parameter selectors, and ResourceClaim lifecycle controls across all deployment manifests.

Prohibited Anti-Pattern: Unpartitioned MPS and Legacy Shared GPU Requests Inducing Host Kernel Watchdog Hangs and Cross-Tenant Cache Starvation

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail - Enforces Kubernetes 1.32 Dynamic Resource Allocation (DRA) structured parameters to partition co-located distributed LLM inference micro-slices into hardware-isolated compute and memory domains. Prevents unthrottled tensor engine bus contention, L2 cache thrashing, and kernel watchdog timeouts caused by unmanaged multi-tenant GPU overcommit. Mandates explicit DeviceClass configurations, Structured Parameter selectors, and ResourceClaim lifecycle controls across all deployment manifests.
globs: infra/**/*.ts, deploy/**/*.ts, k8s/**/*.ts, src/infrastructure/**/*.ts
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/k8s-132-dra-gpu-partitioning-guardrail"
---

# Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unpartitioned MPS and Legacy Shared GPU Requests Inducing Host Kernel Watchdog Hangs and Cross-Tenant Cache Starvation

## System Constraints
You are a Principal Infrastructure Architect enforcing Kubernetes 1.32 Dynamic Resource Allocation (DRA) v1beta1 standards for heterogeneous GPU multi-tenancy. Mandate hardware-level isolation (e.g., NVIDIA MIG or DRA Structured Parameter constraints) on all distributed LLM inference workloads to eliminate PCIe/NVLink interconnect saturations, HBM bandwidth hogging, and CUDA runtime kernel panics.

## Strict Guidelines
- Engineers MUST ALWAYS declare Kubernetes 1.32 Dynamic Resource Allocation via resource.k8s.io/v1beta1 ResourceClaimTemplates instead of legacy resources.limits['nvidia.com/gpu'].
- Engineers MUST NOT allow unconstrained CUDA Multi-Process Service (MPS) co-location on multi-tenant inference nodes without DRA Structured Parameter device constraints.
- Code SHOULD specify CEL-based selector requests within DRA claim templates enforcing strict memory slice geometry and compute slice hardware allocation bounds.
- Services MUST declare allocationMode 'ExactCount' with deterministic device class references to guarantee non-overlapping hardware memory channels.
- Components NEVER mount raw GPU devices across untrusted tenant boundaries without hardware-enforced Multi-Instance GPU (MIG) or isolated SRIOV physical function mappings.

## Bad vs Good Implementations
### Kubernetes Pod Deployment with Dynamic Resource Allocation (DRA) Structured Parameters

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Legacy 'nvidia.com/gpu' limits cannot enforce memory bus isolation or partitioned multi-tenancy. Co-located LLM workers sharing the same compute/memory channel will trigger HBM bus thrashing, tail latency degradation, and host CUDA watchdog kernel panics under bursty attention matrix workloads.
```typescript
// Anti-pattern: Relying on legacy extended resources and unpartitioned GPU sharing
// This leads to cross-tenant memory bus contention and CUDA driver kernel hangs.
import { V1Pod, V1Container } from '@kubernetes/client-node';

export function createInferenceWorkerPod(tenantId: string): V1Pod {
  return {
    apiVersion: 'v1',
    kind: 'Pod',
    metadata: { name: `inference-worker-${tenantId}` },
    spec: {
      containers: [
        {
          name: 'vllm-engine',
          image: 'vllm/vllm-openai:v0.6.6',
          resources: {
            limits: {
              // Insecure & unisolated: Multiple tenants share whole GPU or MPS
              'nvidia.com/gpu': '1'
            }
          }
        } as V1Container
      ]
    }
  };
}
```

#### Production Standard (Correct)
> **Standard**: Using Kubernetes 1.32 DRA v1beta1 ResourceClaimTemplates ensures each co-located inference micro-slice acquires a dedicated, hardware-partitioned MIG profile (3g.20gb). Memory bandwidth and crossbar buses are isolated at the silicon level, completely eliminating memory bus contention and cross-tenant kernel panics.
```typescript
// Production standard: Kubernetes 1.32 DRA with structured parameters and strict MIG partitioning
import { V1Pod, V1Container } from '@kubernetes/client-node';

export function createInferenceWorkerPod(tenantId: string): V1Pod {
  return {
    apiVersion: 'v1',
    kind: 'Pod',
    metadata: {
      name: `inference-worker-${tenantId}`,
      labels: { 'tenant.isolation': 'hardware-mig', 'app.kubernetes.io/part-of': 'inference-mesh' }
    },
    spec: {
      resourceClaims: [
        {
          name: 'isolated-gpu',
          request: `dra-mig-slice-${tenantId}`
        }
      ],
      resourceClaimTemplates: [
        {
          metadata: { name: `dra-mig-slice-${tenantId}` },
          spec: {
            apiVersion: 'resource.k8s.io/v1beta1',
            kind: 'ResourceClaimTemplate',
            spec: {
              spec: {
                devices: {
                  requests: [
                    {
                      name: 'mig-slice',
                      deviceClassName: 'nvidia-mig-isolated',
                      allocationMode: 'ExactCount',
                      count: 1,
                      selectors: [
                        {
                          cel: {
                            expression: "device.attributes['gpu.nvidia.com'].memorySlice == '3g.20gb' && device.attributes['gpu.nvidia.com'].sharingMode == 'hardwareMIG'"
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      ],
      containers: [
        {
          name: 'vllm-engine',
          image: 'vllm/vllm-openai:v0.6.6',
          resources: {
            claims: [{ name: 'isolated-gpu' }]
          }
        } as V1Container
      ]
    }
  };
}
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail

Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces Kubernetes 1.32 Dynamic Resource Allocation (DRA) structured parameters to partition co-located distributed LLM inference micro-slices into hardware-isolated compute and memory domains. Prevents unthrottled tensor engine bus contention, L2 cache thrashing, and kernel watchdog timeouts caused by unmanaged multi-tenant GPU overcommit. Mandates explicit DeviceClass configurations, Structured Parameter selectors, and ResourceClaim lifecycle controls across all deployment manifests. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Unpartitioned MPS and Legacy Shared GPU Requests Inducing Host Kernel Watchdog Hangs and Cross-Tenant Cache Starvation Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftUnpartitioned MPS and Legacy Shared GPU Requests Inducing Host Kernel Watchdog Hangs and Cross-Tenant Cache StarvationCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS declare Kubernetes 1.32 Dynamic Resource Allocation via resource.k8s.io/v1beta1 ResourceClaimTemplates instead of legacy resources.limits['nvidia.com/gpu'].

Engineers MUST ALWAYS declare Kubernetes 1.32 Dynamic Resource Allocation via resource.k8s.io/v1beta1 ResourceClaimTemplates instead of legacy resources.limits['nvidia.com/gpu'].

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST NOT allow unconstrained CUDA Multi-Process Service (MPS) co-location on multi-tenant inference nodes without DRA Structured Parameter device constraints.

Engineers MUST NOT allow unconstrained CUDA Multi-Process Service (MPS) co-location on multi-tenant inference nodes without DRA Structured Parameter device constraints.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Code SHOULD specify CEL-based selector requests within DRA claim templates enforcing strict memory slice geometry and compute slice hardware allocation bounds.

Code SHOULD specify CEL-based selector requests within DRA claim templates enforcing strict memory slice geometry and compute slice hardware allocation bounds.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Services MUST declare allocationMode 'ExactCount' with deterministic device class references to guarantee non-overlapping hardware memory channels.

Services MUST declare allocationMode 'ExactCount' with deterministic device class references to guarantee non-overlapping hardware memory channels.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Components NEVER mount raw GPU devices across untrusted tenant boundaries without hardware-enforced Multi-Instance GPU (MIG) or isolated SRIOV physical function mappings.

Components NEVER mount raw GPU devices across untrusted tenant boundaries without hardware-enforced Multi-Instance GPU (MIG) or isolated SRIOV physical function mappings.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Kubernetes 1.32 DRA GPU Partitioning and Memory Bus Contention Guardrail critical for AI coding assistants?

Enforces Kubernetes 1.32 Dynamic Resource Allocation (DRA) structured parameters to partition co-located distributed LLM inference micro-slices into hardware-isolated compute and memory domains. Prevents unthrottled tensor engine bus contention, L2 cache thrashing, and kernel watchdog timeouts caused by unmanaged multi-tenant GPU overcommit. Mandates explicit DeviceClass configurations, Structured Parameter selectors, and ResourceClaim lifecycle controls across all deployment manifests. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Unpartitioned MPS and Legacy Shared GPU Requests Inducing Host Kernel Watchdog Hangs and Cross-Tenant Cache Starvation) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Kubernetes