Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if $useServiceAccount }}
{{- if or .Values.serviceAccount.create $useServiceAccount }}
{{- if .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ include "nvidia-device-plugin.fullname" . }}-service-account
{{- end }}
{{- end }}
{{- if $options.hasConfigMap }}
shareProcessNamespace: true
initContainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if $useServiceAccount }}
{{- if or .Values.serviceAccount.create $useServiceAccount }}
{{- if .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ include "nvidia-device-plugin.fullname" . }}-service-account
{{- end }}
{{- end }}
{{- if $options.hasConfigMap }}
shareProcessNamespace: true
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{{- if .Values.devicePlugin.enabled }}
---
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
{{- $useServiceAccount := $options.hasConfigMap }}
{{- $configMapName := (include "nvidia-device-plugin.configMapName" .) | trim }}
{{- $daemonsetName := printf "%s-mps-control-daemon" (include "nvidia-device-plugin.fullname" .) | trunc 63 | trimSuffix "-" }}
apiVersion: apps/v1
Expand Down Expand Up @@ -50,12 +51,16 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if $options.hasConfigMap }}
{{- if or .Values.serviceAccount.create $useServiceAccount }}
{{- if .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ include "nvidia-device-plugin.fullname" . }}-service-account
{{- end }}
{{- end }}
{{- if not .Values.mps.enableHostPID }}
shareProcessNamespace: true
{{- end }}
{{- end }}
{{- if .Values.mps.enableHostPID }}
hostPID: true
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
---
{{- $options := (include "nvidia-device-plugin.options" . | fromJson) }}
{{- if or $options.hasConfigMap ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
{{- if or .Values.serviceAccount.create $options.hasConfigMap ( and .Values.gfd.enabled .Values.nfd.enableNodeFeatureApi ) }}
apiVersion: v1
kind: ServiceAccount
metadata:
{{- if .Values.serviceAccount.name }}
name: {{ .Values.serviceAccount.name }}
{{- else }}
name: {{ include "nvidia-device-plugin.fullname" . }}-service-account
{{- end }}
namespace: {{ include "nvidia-device-plugin.namespace" . }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "nvidia-device-plugin.labels" . | nindent 4 }}
{{- end }}
11 changes: 11 additions & 0 deletions deployments/helm/nvidia-device-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ podAnnotations: {}
podSecurityContext: {}
securityContext: {}

serviceAccount:
# Specifies whether a service account should be created.
create: false

# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template.
# name: ""

# Optional additional annotations to add to the controller's Service Account. Templates are allowed for both keys and values.
# annotations: {}

resources: {}
nodeSelector: {}
affinity:
Expand Down