Skip to content

Commit 2542d7b

Browse files
committed
Add anyuid SCC to compute domain service account on OpenShift
Red Hat OpenShift blocks writing into `/etc`, causing the following error in compute-domain-daemon pods: ``` IMEXDaemonUpdateLoop failed, initiate shutdown: writeNodesConfig failed: failed to create nodes config file: open /etc/nvidia-imex/nodes_config.cfg: permission denied ``` Binding `anyuid` SCC to the service account when run on OpenShift solves this problem. Signed-off-by: Vitaliy Emporopulo <[email protected]>
1 parent ad79134 commit 2542d7b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

deployments/helm/nvidia-dra-driver-gpu/templates/compute-domain-daemon-rbac.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ rules:
88
resources: ["computedomains", "computedomains/status"]
99
verbs: ["get", "list", "watch", "update", "patch"]
1010

11+
{{- $root := . -}}
1112
{{- range $namespace := splitList "," (include "nvidia-dra-driver-gpu.namespaces" .) }}
1213
---
1314
apiVersion: v1
@@ -28,4 +29,19 @@ roleRef:
2829
kind: ClusterRole
2930
name: compute-domain-daemon-role
3031
apiGroup: rbac.authorization.k8s.io
31-
{{- end }}
32+
{{- if $root.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints" }}
33+
---
34+
apiVersion: rbac.authorization.k8s.io/v1
35+
kind: ClusterRoleBinding
36+
metadata:
37+
name: compute-domain-daemon-anyuid-role-binding-{{ $namespace }}
38+
subjects:
39+
- kind: ServiceAccount
40+
name: compute-domain-daemon-service-account
41+
namespace: {{ $namespace }}
42+
roleRef:
43+
kind: ClusterRole
44+
name: system:openshift:scc:anyuid
45+
apiGroup: rbac.authorization.k8s.io
46+
{{- end }}
47+
{{- end }}

0 commit comments

Comments
 (0)