Skip to content

Commit

Permalink
Allows autopilot containers to run privileged for nvidia-smi
Browse files Browse the repository at this point in the history
Because of our use of
ACCEPT_NVIDIA_VISIBLE_DEVICES_ENVVAR_WHEN_UNPRIVILEGED=false, we set
privileged=true for the autopilot service account so it can load the
NVIDIA tools like nvidia-smi to check on the GPU health, without
actually claiming the GPU.
  • Loading branch information
computate committed Feb 3, 2025
1 parent ff74fdc commit c54c640
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions autopilot/base/clusterrolebindings/autopilot-privileged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: autopilot-privileged
namespace: autopilot
subjects:
- kind: ServiceAccount
name: autopilot
namespace: autopilot
roleRef:
kind: ClusterRole
name: system:openshift:scc:privileged
apiGroup: rbac.authorization.k8s.io
1 change: 1 addition & 0 deletions autopilot/base/clusterrolebindings/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- autopilot.yaml
- autopilot-privileged.yaml
- prometheus-k8s-autopilot.yaml
4 changes: 4 additions & 0 deletions autopilot/base/daemonsets/autopilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
image: quay.io/autopilot/autopilot:v2.1.0
imagePullPolicy: Always
name: device-plugin-validation
securityContext:
privileged: true
containers:
- image: quay.io/autopilot/autopilot:v2.1.0
command:
Expand Down Expand Up @@ -88,3 +90,5 @@ spec:
nvidia.com/gpu: '0'
requests:
nvidia.com/gpu: '0'
securityContext:
privileged: true

0 comments on commit c54c640

Please sign in to comment.