Skip to content

Commit

Permalink
Add condition to helm chart to enable computeDomains and GPUs separately
Browse files Browse the repository at this point in the history
For now, enabling GPUs is not supported (even though it's the default).
We error out if the GPU resource is enabled with instructions on how to
disable it.

Signed-off-by: Kevin Klues <[email protected]>
  • Loading branch information
klueska committed Feb 6, 2025
1 parent e9c72fc commit 7a33e9a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/clusters/gke/install-dra-driver-gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ helm upgrade -i --create-namespace --namespace nvidia nvidia-dra-driver-gpu ${PR
--set controller.priorityClassName="" \
--set kubeletPlugin.priorityClassName="" \
--set nvidiaDriverRoot="/opt/nvidia" \
--set resources.gpus.enabled=false \
--set kubeletPlugin.tolerations[0].key=nvidia.com/gpu \
--set kubeletPlugin.tolerations[0].operator=Exists \
--set kubeletPlugin.tolerations[0].effect=NoSchedule
1 change: 1 addition & 0 deletions demo/clusters/kind/install-dra-driver-gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ helm upgrade -i --create-namespace --namespace nvidia nvidia-dra-driver-gpu ${PR
${NVIDIA_CTK_PATH:+--set nvidiaCtkPath=${NVIDIA_CTK_PATH}} \
${NVIDIA_DRIVER_ROOT:+--set nvidiaDriverRoot=${NVIDIA_DRIVER_ROOT}} \
${MASK_NVIDIA_DRIVER_PARAMS:+--set maskNvidiaDriverParams=${MASK_NVIDIA_DRIVER_PARAMS}} \
--set resources.gpus.enabled=false \
--wait

set +x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.resources.computeDomains.enabled }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -74,3 +75,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if or .Values.resources.computeDomains.enabled .Values.resources.gpus.enabled }}
---
apiVersion: apps/v1
kind: DaemonSet
Expand Down Expand Up @@ -48,6 +49,7 @@ spec:
securityContext:
{{- toYaml .Values.kubeletPlugin.podSecurityContext | nindent 8 }}
containers:
{{- if .Values.resources.computeDomains.enabled }}
- name: compute-domain
securityContext:
{{- toYaml .Values.kubeletPlugin.containers.computeDomain.securityContext | nindent 10 }}
Expand Down Expand Up @@ -80,6 +82,7 @@ spec:
- name: driver-root
mountPath: /driver-root
readOnly: true
{{- end }}
volumes:
- name: plugins-registry
hostPath:
Expand All @@ -105,3 +108,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@
{{- $error = printf "%s\nSee: https://helm.sh/docs/helm/helm_install/#options" $error }}
{{- fail $error }}
{{- end }}

{{- if .Values.resources.gpus.enabled }}
{{- $error := "" }}
{{- $error = printf "%s\nThe default value of 'resources.gpus.enabled=true' is not yet supported." $error }}
{{- $error = printf "%s\nIt is set to true by default to future proof it as the default once support for it becomes available." $error }}
{{- $error = printf "%s\nUntil then, please explicitly set 'resources.gpus.enabled=false' when installing this chart." $error }}
{{- fail $error }}
{{- end }}
6 changes: 6 additions & 0 deletions deployments/helm/nvidia-dra-driver-gpu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

resources:
gpus:
enabled: true
computeDomains:
enabled: true

controller:
priorityClassName: "system-node-critical"
podAnnotations: {}
Expand Down

0 comments on commit 7a33e9a

Please sign in to comment.