/
csi-nodeplugin-nfsplugin.yaml
101 lines (101 loc) · 3.81 KB
/
csi-nodeplugin-nfsplugin.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This YAML file contains driver-registrar & csi driver nodeplugin API objects
# that are necessary to run CSI nodeplugin for nfs
{{- $csiNFSProperties := merge .Values $.Values.global}}
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-nodeplugin-nfsplugin
labels:
{{- include "common.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: csi-nodeplugin-nfsplugin
template:
metadata:
labels:
{{- include "common.labels" . | nindent 8 }}
app: csi-nodeplugin-nfsplugin
{{- if or (hasKey .Values "clusterAutoscalerDSEviction") (hasKey .Values.global "clusterAutoscalerDSEviction") }}
annotations:
cluster-autoscaler.kubernetes.io/enable-ds-eviction: {{ .Values.clusterAutoscalerDSEviction | default .Values.global.clusterAutoscalerDSEviction | quote }}
{{- end}}
spec:
{{- if or (.Values.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ .Values.priorityClassName | default .Values.global.priorityClassName }}
{{- end }}
{{- if or (.Values.dockerRegistrySecret) (.Values.global.dockerRegistrySecret) }}
imagePullSecrets:
- name: {{ .Values.dockerRegistrySecret | default .Values.global.dockerRegistrySecret }}
{{- end}}
serviceAccountName: csi-nodeplugin
hostNetwork: true
containers:
- name: node-driver-registrar
{{- with $csiNFSProperties.sidecars}}
image: "{{ .baseRepo }}/{{ .images.nodeDriverRegistrar.image }}:{{ .images.nodeDriverRegistrar.tag }}"
{{- end}}
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/csi-nfsplugin /registration/csi-nfsplugin-reg.sock"]
args:
- --v=10
- --csi-address=/plugin/csi.sock
- --kubelet-registration-path={{ $csiNFSProperties.sidecars.kubeletPath }}/plugins/csi-nfsplugin/csi.sock
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: registration-dir
mountPath: /registration
- name: nfs
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: "{{ $csiNFSProperties.baseRepo }}/{{ $csiNFSProperties.csinfs.image }}:{{ $csiNFSProperties.csinfs.tag }}"
args :
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
env:
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix://plugin/csi.sock
imagePullPolicy: "Always"
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: pods-mount-dir
mountPath: {{ $csiNFSProperties.sidecars.kubeletPath }}/pods
mountPropagation: "Bidirectional"
volumes:
- name: plugin-dir
hostPath:
path: {{ $csiNFSProperties.sidecars.kubeletPath }}/plugins/csi-nfsplugin
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: {{ $csiNFSProperties.sidecars.kubeletPath }}/pods
type: Directory
- hostPath:
path: {{ $csiNFSProperties.sidecars.kubeletPath }}/plugins_registry
type: Directory
name: registration-dir
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}