-
Notifications
You must be signed in to change notification settings - Fork 595
/
controllerplugin-statefulset.yaml
162 lines (162 loc) · 7.56 KB
/
controllerplugin-statefulset.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
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
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: {{ include "openstack-manila-csi.controllerplugin.fullname" . }}
labels:
app: {{ include "openstack-manila-csi.name" . }}
chart: {{ include "openstack-manila-csi.chart" . }}
component: {{ .Values.controllerplugin.name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
serviceName: {{ include "openstack-manila-csi.controllerplugin.fullname" . }}
replicas: 1
selector:
matchLabels:
app: {{ include "openstack-manila-csi.name" . }}
component: {{ .Values.controllerplugin.name }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ include "openstack-manila-csi.name" . }}
chart: {{ include "openstack-manila-csi.chart" . }}
component: {{ .Values.controllerplugin.name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
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=5"
- "--csi-address=$(ADDRESS)"
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
- "--feature-gates=Topology=true"
{{- end }}
env:
- name: ADDRESS
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
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=5"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
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=5"
- "--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"
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=5
--nodeid=$(NODE_ID)
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
--with-topology
--nodeaz={{ $.Values.csimanila.nodeAZ }}
{{- 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="{{ $.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-controllerplugin.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 }}
- 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 }}
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
{{- 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 }}