feat(examples): add Kubernetes GPU autoscaling recipe - #111
Conversation
Signed-off-by: maggiezha <42832776+maggiezha@users.noreply.github.com>
Signed-off-by: maggiezha <42832776+maggiezha@users.noreply.github.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Thanks for moving this Kubernetes GPU autoscaling work into the community repository. The static checks and contract tests are in good shape, but two items need to be completed before approval:
- Please provide a documented live Kubernetes/GPU validation of the core workflow. The recipe's primary behavior is GPU-backed inference and HPA scaling, but the PR currently states that no live Kubernetes/H100 validation was run. At minimum, validate deployment, authenticated inference, the custom GPU metric, and a scale-up/scale-down cycle on a suitable cluster.
- Please complete the contributor review of the agent-generated text and check the corresponding PR-template item. The PR currently marks this as required before merge.
Once those are complete, we can reassess the PR for approval.
Thanks for the prompt reply: 1. I had to give up the DGX H100 test, because the admin already setup the cluster to have GPU time slicing to 4 replicas per GPU, which will affect my K8s pod and GPU utilization per GPU, this H100 test is pending on if the cluster admin agree to change GPU operator to cancel the GPU time slicing to exclusive GPU allocation. Instead, I had to go back to the same hardware I used for PR7459: Brev 4xL40S on AWS: NVIDIA L40S (44.70 GiB) 4 GPUs x 48 CPUs 384 GiB RAM |
…t L40S validation Replace ingress-nginx with Envoy Gateway LeastRequest for OpenShell and external routes, extend hpa-load-test for distribution checks, and record live 4xL40S validation evidence. Signed-off-by: maggiezha <maggiez@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Thank you for the update. The documented 4× L40S run now covers the chart deployment, authenticated inference, GPU metric, HPA scale-up/scale-down, and Envoy LeastRequest distribution. The contributor and documentation-review checklist items are also complete on the current head.
Two items still need attention before approval:
- Separate the internal cleartext route from externally exposed Envoy Services. The current Gateway always creates a hostname-unrestricted HTTP listener and OpenShell route on port 80. When
ingress.gateway.serviceTypeis changed toNodePortorLoadBalancer, that same listener becomes externally reachable even when TLS is configured. Requests using another Host value or the load-balancer IP can select the OpenShell route instead of the hostname-specific HTTPS redirect, bypassing Gateway TLS and Basic authentication while carrying the reusable Bearer credential and inference traffic over cleartext. Please either use a separate ClusterIP-only Gateway/dataplane for OpenShell and a distinct TLS-only external Gateway, or rejectNodePort/LoadBalancerwhile the internal HTTP listener is present. Add a render/security contract test for the chosen boundary. - Complete or narrow the end-to-end validation claim. The L40S evidence validates the GPU chart and Envoy path, but the PR still advertises a NemoClaw/OpenShell sandbox workflow and explicitly states that sandbox creation was not live-validated. Please run the actual sandbox creation and inference path through
https://inference.local, including a model request from the sandbox, or narrow the recipe's advertised scope so the unvalidated sandbox integration is not presented as a completed workflow.
The available local security, Kubernetes, inference-authentication, syntax, SPDX, taxonomy, and diff checks pass on 196fba6.
Related Issue
N/A. This moves the public work from NVIDIA/NemoClaw pull request #7459 into the repository designated for community examples, and updates the load balancer from ingress-nginx to Envoy Gateway with LeastRequest.
Description
Add an experimental NVIDIA-authored Kubernetes recipe that runs a CPU-only NemoClaw/OpenClaw agent in an OpenShell sandbox and sends inference through Envoy Gateway (LeastRequest) to authenticated Ollama replicas on NVIDIA GPUs in the same cluster. A Kubernetes Horizontal Pod Autoscaler scales only the Ollama inference pods from the per-pod
gpu_utilization_percentmetric through DCGM Exporter, Prometheus, and Prometheus Adapter.The runtime path is entirely on-premises:
The sandbox image contains no inference credential. OpenShell holds the in-cluster API key and injects it as Bearer when forwarding requests through the Envoy dataplane to the inference pods. The setup does not use
NVIDIA_API_KEYor a hosted GPU endpoint, and the sandbox policy removes and verifies removal of the inheritedintegrate.api.nvidia.comendpoint before the agent starts.Source migration
NVIDIA/NemoClaw: deploy/helm/gpu_autoscaling_k8s/NVIDIA/nemoclaw-community: examples/recipes/nvidia/kubernetes-gpu-autoscaling/77334ccbbadba2c5079fe9e99fe80a3cddc846b5.v0.0.104atf389c9d872775006ae069473f58250fa8f3ad40f, OpenShell0.0.85, and Agent Sandboxv0.5.0.NemoClaw and OpenShell path
LeastRequest), which forwards Bearer-authenticated requests to the Ollama inference pods.0.0.85idle-sandbox lifecycle, capabilities, privilege-separation limitation, cleanup, and coordinated pin-update procedure.Security and lifecycle boundaries
Authorization: Beareron the OpenShell/Envoy path, orX-Api-Keyfor external clients when Gateway Basic auth already ownsAuthorization). Health, readiness, and metrics remain unauthenticated.TARGET_PODS/MAX_REPLICASto the node's allocatable GPU count.maxGpusdefault.This remains an unsupported, non-production community experiment; it does not establish native Kubernetes as a supported NemoClaw product surface.
Verification
python3 scripts/check_license_headers.py --checkpython3 scripts/check_label_taxonomy.pypython3 -m unittest scripts.tests.test_governance_taxonomypython3 scripts/check_pr_title.py --advisory 'feat(examples): add Kubernetes GPU autoscaling recipe'git diff --checkbash scripts/test-script-security-contract.shbash scripts/test-nemoclaw-k8s-contract.shnode scripts/test-inference-auth-contract.mjsbash scripts/test-render-contract.shwith Helm 3.20.2 onPATHhelm lint . --set ingress.allowInsecureHttp=truehostPathupstream/main; it is zero commits behind196fba6is signed and reportedVerifiedby GitHubX-Api-Key; OpenShell-path Bearer through Envoy),gpu_utilization_percentHPA signal, scale-up/scale-down viahpa-load-test.sh, and Envoy distribution check (concurrent chat completions across Ready GPU pods). Full OpenShell/NemoClaw sandbox-image creation on this node remains optional follow-up and is not claimed as live-validated here.Documentation Writer Review
docs-updated196fba6ed5434735752336c7d04a95dbbd301ca9Release And Compliance
.envfiles, private certificates, or token caches.THIRD-PARTY-NOTICES.Signed-off-by: maggiezha maggiez@nvidia.com