Skip to content

[WIP] : remove unnecessary permissions, add validating-admissions-policies#2202

Draft
rahulait wants to merge 1 commit intoNVIDIA:mainfrom
rahulait:update-permissions
Draft

[WIP] : remove unnecessary permissions, add validating-admissions-policies#2202
rahulait wants to merge 1 commit intoNVIDIA:mainfrom
rahulait:update-permissions

Conversation

@rahulait
Copy link
Contributor

Description

This is still work in progress. PR will be updated as we get more feedback.

Key changes include:

  1. Adding ValidatingAdmissionPolicy for gpu-operator service account
    a. Restrict to certain runtime handlers when creating a runtime class
    b. Restrict to certain node labels when labeling nodes
    c. Restrict to certain labels that can be added to namespaces
  2. Remove privileges which are not required

Openshift specific OLM bundle generation still needs to be updated in the PR

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

@rahulait rahulait force-pushed the update-permissions branch from eb025d7 to 55e699c Compare March 11, 2026 15:03
- name: gpu-operator-service-account
expression: request.userInfo.username == 'system:serviceaccount:{{ .Release.Namespace }}:gpu-operator'
- name: target-namespace
expression: object.metadata.name in ['{{ .Release.Namespace }}', 'nvidia-gpu-operator']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need inputs here if these are the only namespaces we label or there can be others as well in case of openshift

@@ -0,0 +1,141 @@
{{- if .Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1/ValidatingAdmissionPolicy" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be further restricted to be installed if someone requests validatingadmissionpolicy guardrails in values.yaml. I haven't added added that and looking for feedback if we should do something like that or let these be always installed if supported by k8s.

Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com>
@rahulait rahulait force-pushed the update-permissions branch from 55e699c to 76ad771 Compare March 12, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant