feat(k8s): verify the tenant can override the GPU Operator driver (K8S25-02) - #618
Draft
abegnoche wants to merge 1 commit into
Draft
feat(k8s): verify the tenant can override the GPU Operator driver (K8S25-02)#618abegnoche wants to merge 1 commit into
abegnoche wants to merge 1 commit into
Conversation
…S25-02) K8S25-01 only asserts the GPU Operator namespace exists and has a running pod. K8S25-02 is the substantive half of K8S25: a provider may ship the operator as a managed add-on, but a tenant must still be able to install the operator and driver versions its workloads need. K8sGpuOperatorOverrideCheck proves that without mutating the cluster: - it locates the operator-managed driver version (ClusterPolicy, falling back to NVIDIADriver) and fails when neither exists, so "no driver configuration" cannot pass as evidence of an override; - it asks the API server whether the tenant may rewrite that configuration and the operator's own workloads; - it dry-runs the override server-side and reads the version back off the admitted object, which catches both a webhook that rejects tenant versions and one that accepts the write while pinning its own version. The tenant-required version comes from the same inventory field K8sDriverVersionCheck asserts is installed. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #220.
What
K8S25-01only asserts that the GPU Operator namespace exists and has a running pod.K8S25-02is the substantive half of the requirement: "Provider-default accelerator operators and drivers shall be replaceable or overridable to allow installation of tenant-required operator and driver versions." It had no validation class and no wiring.K8sGpuOperatorOverrideCheckproves the tenant holds that authority, without mutating the cluster:clusterpolicies.nvidia.com, falling back tonvidiadrivers.nvidia.com(the per-node-pool CR GPU Operator 24.6+ adds). When neither exists there is no operator-managed driver version to override, and the check fails rather than passing on the absence of evidence. A query error (unreachable API) is reported separately from a genuinely missing configuration.kubectl auth can-iforpatch/update(override in place) anddelete/create(swap the configuration out) on the driver configuration, pluspatch/updateon Deployments and DaemonSets in the operator namespace (installing a different operator version rewrites its own workloads).auth can-ianswers "no" with a non-zero exit, so the answer is parsed from stdout and an inconclusive probe fails instead of being read as a pass.kubectl patch --dry-run=serveris evaluated by RBAC and by every mutating and validating webhook but never persisted. The requested version is then read back off the returned object, which is what distinguishes a provider that permits tenant overrides from one that accepts the write and pins its own version anyway.The tenant-required version comes from
steps.setup.kubernetes.driver_version— the same inventory fieldK8sDriverVersionCheckasserts is installed — so the check proves the tenant can reach exactly the version the stack is expected to run, rather than a guessed placeholder.Files
isvtest/src/isvtest/validations/k8s_gpu_operator.py— the new check, alongside the two existing K8S25-01 checks.isvtest/tests/test_k8s_gpu_operator.py— 10 new cases: happy path, NVIDIADriver fallback, missing configuration, query error, RBAC denial on the configuration, read-only operator workloads, inconclusive probe, admission rejection, silent version pin-back, and the no-target-version skip.isvctl/configs/suites/k8s.yaml— wiresK8S25-02next toK8S25-01.docs/test-plan.yaml/docs/test-plan.adoc— adds thekuberneteslabel the coverage guardrail requires for aK8S*id, and the regenerated row.isvtest/src/isvtest/released_tests.jsonis deliberately untouched: the check ships unreleased and lands in the manifest via a release commit. Run it withISVTEST_INCLUDE_UNRELEASED=1until then.Verification
No Kubernetes cluster is reachable from the authoring environment, so the check was exercised two ways: mocked-kubectl unit tests, and end-to-end through the real orchestrator against a throwaway kubectl-compatible CLI selected with
KUBECTL. The latter drives the actual step output and Jinja2 wiring — the fake cluster's node labels report the tenant-required driver580.82.07while its ClusterPolicy carries the provider default550.54.15, so the run proves the wiring end to end and not just the class.clusterpolicies.nvidia.com/cluster-policy spec.driver.version accepts '580.82.07' (currently '550.54.15')Admission kept the provider-default driver version: requested '580.82.07' ..., admitted object reports '550.54.15'Tenant is not authorized to replace the provider-default GPU Operator: cannot delete clusterpolicies.nvidia.comNo GPU Operator driver configuration found (...); the driver version is not operator-managed, so a tenant override cannot be provenmake test— 1717 isvtest + 124 scripts tests passmake demo-test— all my-isv suites passmake lint,uvx pre-commit run -a— clean, including theplan-coverageandvalidate-suitesguardrailsScope note
docs/references/GPU-Operator-Self-Certify-Integration-Solution-for-AI-Cloud-Validation-Suite-PRD.mddefinesGPUOP-03 "Driver Update", owned by the GPU Operator team per ENT-REQ-000. This check is deliberately scoped to whether the tenant may replace or override — install ownership, authorization, and admission — and leaves "does a driver update work end to end" to that track.