-
Notifications
You must be signed in to change notification settings - Fork 610
/
nodeplugin-daemonset.yaml
130 lines (130 loc) · 5.53 KB
/
nodeplugin-daemonset.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ include "openstack-manila-csi.nodeplugin.fullname" . }}
labels:
{{- include "openstack-manila-csi.nodeplugin.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "openstack-manila-csi.nodeplugin.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "openstack-manila-csi.nodeplugin.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "openstack-manila-csi.serviceAccountName.nodeplugin" . }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
{{- range .Values.shareProtocols }}
- name: {{ .protocolSelector | lower }}-registrar
image: "{{ $.Values.nodeplugin.registrar.image.repository }}:{{ $.Values.nodeplugin.registrar.image.tag }}"
args:
- "-v={{ $.Values.logVerbosityLevel }}"
- "--csi-address=/csi/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi.sock"
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
imagePullPolicy: {{ $.Values.nodeplugin.registrar.image.pullPolicy }}
volumeMounts:
- name: {{ .protocolSelector | lower }}-plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
resources:
{{ toYaml $.Values.nodeplugin.registrar.resources | indent 12 }}
- name: {{ .protocolSelector | lower }}-nodeplugin
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: "{{ $.Values.csimanila.image.repository }}:{{ $.Values.csimanila.image.tag | default $.Chart.AppVersion }}"
command: ["/bin/sh", "-c",
'/bin/manila-csi-plugin
-v={{ $.Values.logVerbosityLevel }}
--nodeid=$(NODE_ID)
{{- if $.Values.csimanila.runtimeConfig.enabled }}
--runtime-config-file=/runtimeconfig/runtimeconfig.json
{{- end }}
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
--with-topology
--nodeaz={{ $.Values.csimanila.nodeAZ }}
{{- end }}
--endpoint=$(CSI_ENDPOINT)
--drivername=$(DRIVER_NAME)
--share-protocol-selector=$(MANILA_SHARE_PROTO)
--fwdendpoint=$(FWD_CSI_ENDPOINT)
--cluster-id="{{ $.Values.csimanila.clusterID }}"'
]
env:
- name: DRIVER_NAME
value: {{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi.sock"
- name: FWD_CSI_ENDPOINT
value: "unix://{{ .fwdNodePluginEndpoint.dir }}/{{ .fwdNodePluginEndpoint.sockFile }}"
- name: MANILA_SHARE_PROTO
value: "{{ .protocolSelector }}"
imagePullPolicy: {{ $.Values.csimanila.image.pullPolicy }}
volumeMounts:
- name: {{ .protocolSelector | lower }}-plugin-dir
mountPath: /var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
- name: {{ .protocolSelector | lower }}-fwd-plugin-dir
mountPath: {{ .fwdNodePluginEndpoint.dir }}
{{- if $.Values.csimanila.runtimeConfig.enabled }}
- name: {{ .protocolSelector | lower }}-runtime-config-dir
mountPath: /runtimeconfig
readOnly: true
{{- end }}
resources:
{{ toYaml $.Values.nodeplugin.nodeplugin.resources | indent 12 }}
{{- end }}
volumes:
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry
type: Directory
{{- range .Values.shareProtocols }}
- name: {{ .protocolSelector | lower }}-plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
type: DirectoryOrCreate
- name: {{ .protocolSelector | lower }}-fwd-plugin-dir
hostPath:
path: {{ .fwdNodePluginEndpoint.dir }}
type: DirectoryOrCreate
{{- if $.Values.csimanila.runtimeConfig.enabled }}
- name: {{ .protocolSelector | lower }}-runtime-config-dir
configMap:
name: manila-csi-runtimeconf-cm
{{- end }}
{{- end }}
{{- if .Values.nodeplugin.affinity }}
affinity: {{ toYaml .Values.nodeplugin.affinity | nindent 8 }}
{{- end }}
{{- if .Values.nodeplugin.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeplugin.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.nodeplugin.tolerations }}
tolerations: {{ toYaml .Values.nodeplugin.tolerations | nindent 8 }}
{{- end }}
{{- with .Values.nodeplugin.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.nodeplugin.priorityClassName }}
priorityClassName: {{ .Values.nodeplugin.priorityClassName }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}