Skip to content

Render daemonsets.podSecurityContext in Helm ClusterPolicy template - #2703

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

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

Conversation

@kbix2000

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

The CRD and controller already honor spec.daemonsets.podSecurityContext,
but the Helm chart never forwarded the values field into ClusterPolicy.
@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.

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