mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-04-13 15:56:24 +00:00
Signed-off-by: Mac Chaffee <me@macchaffee.com> This commit creates a separate ServiceAccount for the nfd-worker like the other components. Even though the nfd-worker doesn't need any special RBAC permissions, this feature is useful for nvidia/gpu-operator (a downstream project) which supports PodSecurityPolicies. But since nfd-worker doesn't have its own ServiceAccount, they've bolted on this feature into their fork, which is giving them issues. PodSecurityPolicies are used to grant special permission to nfd-worker to create hostPath volumes.
112 lines
4.2 KiB
YAML
112 lines
4.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "node-feature-discovery.fullname" . }}-master
|
|
labels:
|
|
{{- include "node-feature-discovery.labels" . | nindent 4 }}
|
|
role: master
|
|
spec:
|
|
replicas: {{ .Values.master.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "node-feature-discovery.selectorLabels" . | nindent 6 }}
|
|
role: master
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "node-feature-discovery.selectorLabels" . | nindent 8 }}
|
|
role: master
|
|
annotations:
|
|
{{- toYaml .Values.master.annotations | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "node-feature-discovery.master.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.master.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: master
|
|
securityContext:
|
|
{{- toYaml .Values.master.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- "/usr/bin/grpc_health_probe"
|
|
- "-addr=:8080"
|
|
{{- if .Values.tls.enable }}
|
|
- "-tls"
|
|
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
|
|
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
|
|
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
|
|
{{- end }}
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- "/usr/bin/grpc_health_probe"
|
|
- "-addr=:8080"
|
|
{{- if .Values.tls.enable }}
|
|
- "-tls"
|
|
- "-tls-ca-cert=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
|
|
- "-tls-client-key=/etc/kubernetes/node-feature-discovery/certs/tls.key"
|
|
- "-tls-client-cert=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
|
|
{{- end }}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
failureThreshold: 10
|
|
ports:
|
|
- containerPort: 8080
|
|
name: grpc
|
|
env:
|
|
- name: NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
command:
|
|
- "nfd-master"
|
|
resources:
|
|
{{- toYaml .Values.master.resources | nindent 12 }}
|
|
args:
|
|
{{- if .Values.master.instance | empty | not }}
|
|
- "--instance={{ .Values.master.instance }}"
|
|
{{- end }}
|
|
{{- if .Values.master.extraLabelNs | empty | not }}
|
|
- "--extra-label-ns={{- join "," .Values.master.extraLabelNs }}"
|
|
{{- end }}
|
|
{{- if .Values.master.featureRulesController | kindIs "invalid" | not }}
|
|
- "-featurerules-controller={{ .Values.master.featureRulesController }}"
|
|
{{- else }}
|
|
## By default, disable NodeFeatureRules controller for other than the default instances
|
|
- "-featurerules-controller={{ .Values.master.instance | empty }}"
|
|
{{- end }}
|
|
{{- if .Values.tls.enable }}
|
|
- "--ca-file=/etc/kubernetes/node-feature-discovery/certs/ca.crt"
|
|
- "--key-file=/etc/kubernetes/node-feature-discovery/certs/tls.key"
|
|
- "--cert-file=/etc/kubernetes/node-feature-discovery/certs/tls.crt"
|
|
volumeMounts:
|
|
- name: nfd-master-cert
|
|
mountPath: "/etc/kubernetes/node-feature-discovery/certs"
|
|
readOnly: true
|
|
volumes:
|
|
- name: nfd-master-cert
|
|
secret:
|
|
secretName: nfd-master-cert
|
|
## /TLS ##
|
|
{{- end }}
|
|
{{- with .Values.master.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.master.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.master.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|