-
Notifications
You must be signed in to change notification settings - Fork 665
Expand file tree
/
Copy pathcontrollerplugin-statefulset.yaml
More file actions
188 lines (188 loc) · 8.98 KB
/
controllerplugin-statefulset.yaml
File metadata and controls
188 lines (188 loc) · 8.98 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: {{ include "openstack-manila-csi.controllerplugin.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "openstack-manila-csi.controllerplugin.labels" . | nindent 4 }}
spec:
serviceName: {{ include "openstack-manila-csi.controllerplugin.fullname" . }}
replicas: 1
selector:
matchLabels:
{{- include "openstack-manila-csi.controllerplugin.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "openstack-manila-csi.controllerplugin.labels" . | nindent 8 }}
spec:
securityContext: {{ toYaml .Values.controllerplugin.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "openstack-manila-csi.serviceAccountName.controllerplugin" . }}
containers:
{{- range .Values.shareProtocols }}
- name: {{ .protocolSelector | lower }}-provisioner
image: "{{ $.Values.controllerplugin.provisioner.image.repository }}:{{ $.Values.controllerplugin.provisioner.image.tag }}"
args:
- "-v={{ $.Values.logVerbosityLevel }}"
- "--csi-address=$(ADDRESS)"
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
- "--feature-gates=Topology=true"
{{- end }}
{{- if or $.Values.controllerplugin.provisioner.extraCreateMetadata $.Values.csimanila.pvcAnnotations }}
- "--extra-create-metadata"
{{- end }}
env:
- name: ADDRESS
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
{{- if $.Values.controllerplugin.provisioner.extraEnv }}
{{- toYaml $.Values.controllerplugin.provisioner.extraEnv | nindent 12 }}
{{- end }}
imagePullPolicy: {{ $.Values.controllerplugin.provisioner.image.pullPolicy }}
volumeMounts:
- name: {{ .protocolSelector | lower }}-plugin-dir
mountPath: /var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
resources:
{{ toYaml $.Values.controllerplugin.provisioner.resources | indent 12 }}
- name: {{ .protocolSelector | lower }}-snapshotter
image: "{{ $.Values.controllerplugin.snapshotter.image.repository }}:{{ $.Values.controllerplugin.snapshotter.image.tag }}"
args:
- "-v={{ $.Values.logVerbosityLevel }}"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
{{- if $.Values.controllerplugin.snapshotter.extraEnv }}
{{- toYaml $.Values.controllerplugin.snapshotter.extraEnv | nindent 12 }}
{{- end }}
imagePullPolicy: {{ $.Values.controllerplugin.snapshotter.image.pullPolicy }}
volumeMounts:
- name: {{ .protocolSelector | lower }}-plugin-dir
mountPath: /var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
resources:
{{ toYaml $.Values.controllerplugin.snapshotter.resources | indent 12 }}
- name: {{ .protocolSelector | lower }}-resizer
image: "{{ $.Values.controllerplugin.resizer.image.repository }}:{{ $.Values.controllerplugin.resizer.image.tag }}"
args:
- "-v={{ $.Values.logVerbosityLevel }}"
- "--csi-address=$(ADDRESS)"
- "--handle-volume-inuse-error=false"
env:
- name: ADDRESS
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
{{- if $.Values.controllerplugin.resizer.extraEnv }}
{{- toYaml $.Values.controllerplugin.resizer.extraEnv | nindent 12 }}
{{- end }}
imagePullPolicy: {{ $.Values.controllerplugin.resizer.image.pullPolicy }}
volumeMounts:
- name: {{ .protocolSelector | lower }}-plugin-dir
mountPath: /var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
resources:
{{ toYaml $.Values.controllerplugin.resizer.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 }}
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
--with-topology
{{- end }}
{{- if $.Values.csimanila.runtimeConfig.enabled }}
--runtime-config-file=/runtimeconfig/runtimeconfig.json
{{- end }}
--endpoint=$(CSI_ENDPOINT)
--drivername=$(DRIVER_NAME)
--share-protocol-selector=$(MANILA_SHARE_PROTO)
--fwdendpoint=$(FWD_CSI_ENDPOINT)
{{- if .compatibilitySettings }}
--compatibility-settings={{ .compatibilitySettings }}
{{- end }}
--cluster-id=$(CLUSTER_NAME)
{{- if $.Values.csimanila.pvcAnnotations }}
--pvc-annotations
{{- end }}'
]
env:
- name: DRIVER_NAME
value: {{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
- name: CSI_ENDPOINT
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
- name: FWD_CSI_ENDPOINT
value: "unix://{{ .fwdNodePluginEndpoint.dir }}/{{ .fwdNodePluginEndpoint.sockFile }}"
- name: MANILA_SHARE_PROTO
value: "{{ .protocolSelector }}"
{{- if $.Values.csimanila.clusterID }}
- name: CLUSTER_NAME
value: {{ $.Values.csimanila.clusterID }}
{{- end }}
{{- if $.Values.controllerplugin.nodeplugin.extraEnv }}
{{- toYaml $.Values.controllerplugin.nodeplugin.extraEnv | nindent 12 }}
{{- end }}
{{- with $.Values.controllerplugin.nodeplugin.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
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 }}
- name: pod-mounts
mountPath: /var/lib/kubelet/pods
mountPropagation: Bidirectional
{{- if $.Values.csimanila.runtimeConfig.enabled }}
- name: {{ .protocolSelector | lower }}-runtime-config-dir
mountPath: /runtimeconfig
readOnly: true
{{- end }}
{{- with $.Values.controllerplugin.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{ toYaml $.Values.controllerplugin.nodeplugin.resources | indent 12 }}
{{- end }}
volumes:
{{- 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: Directory
{{- if $.Values.csimanila.runtimeConfig.enabled }}
- name: {{ .protocolSelector | lower }}-runtime-config-dir
configMap:
name: manila-csi-runtimeconf-cm
{{- end }}
{{- end }}
- name: pod-mounts
hostPath:
path: /var/lib/kubelet/pods
type: Directory
{{- with .Values.controllerplugin.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.controllerplugin.affinity }}
affinity: {{ toYaml .Values.controllerplugin.affinity | nindent 8 }}
{{- end }}
{{- if .Values.controllerplugin.nodeSelector }}
nodeSelector: {{ toYaml .Values.controllerplugin.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.controllerplugin.tolerations }}
tolerations: {{ toYaml .Values.controllerplugin.tolerations | nindent 8 }}
{{- end }}
{{- with .Values.controllerplugin.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}