Skip to content

Render daemonsets.podSecurityContext in Helm ClusterPolicy template - #2703

Open
kevinbiebuyck wants to merge 1 commit into
NVIDIA:mainfrom
kevinbiebuyck:fix/helm-daemonsets-podsecuritycontext
Open

Render daemonsets.podSecurityContext in Helm ClusterPolicy template#2703
kevinbiebuyck wants to merge 1 commit into
NVIDIA:mainfrom
kevinbiebuyck:fix/helm-daemonsets-podsecuritycontext

Conversation

@kevinbiebuyck

Copy link
Copy Markdown

Render ClusterPolicy daemonsets.podSecurityContext from Helm values

Problem

ClusterPolicy.spec.daemonsets.podSecurityContext is already supported by the CRD and by the operator controller (applyCommonDaemonsetConfig). Helm values such as:

daemonsets:
  podSecurityContext:
    seLinuxOptions:
      type: spc_t
      level: s0

were silently ignored because deployments/gpu-operator/templates/clusterpolicy.yaml never emitted the field.

This breaks SELinux / OpenShift-style deployments that rely on chart values alone (no manual ClusterPolicy edit).

Change

  • Render daemonsets.podSecurityContext into the ClusterPolicy when set in values.
  • Document the option in values.yaml.

Follow-up request

Global daemonsets.podSecurityContext applies to all operand DaemonSets. We would also like optional per-operand podSecurityContext (e.g. under driver, toolkit, devicePlugin) so SELinux types can be scoped without granting every DaemonSet the same domain. Happy to follow up in a separate PR if preferred.

Test plan

  • helm template with daemonsets.podSecurityContext.seLinuxOptions set → ClusterPolicy includes the field under spec.daemonsets
  • helm template without the value → field absent
  • Install / upgrade: operator applies PSC to operand DaemonSet pod templates

@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@myeolenv

myeolenv commented Aug 1, 2026

Copy link
Copy Markdown

Thanks for the contribution. We will review this PR.

The CRD and controller already honor spec.daemonsets.podSecurityContext,
but the Helm chart never forwarded the values field into ClusterPolicy.

Signed-off-by: EVS\KBIE <k.biebuyck@evs.com>
@kevinbiebuyck
kevinbiebuyck force-pushed the fix/helm-daemonsets-podsecuritycontext branch from 9b2343f to 7f86174 Compare August 3, 2026 10:00
@rahulait

rahulait commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

/ok to test 7f86174

@rahulait rahulait left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. @tariq1890 let me know your thoughts on this.

@tariq1890

Copy link
Copy Markdown
Contributor

Thanks @kbix2000! Please make sure the commit is signed.

@rahulait

rahulait commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@kevinbiebuyck can you please make sure the commit is signed.

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.

4 participants