forked from awslabs/mountpoint-s3-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.yaml
More file actions
209 lines (208 loc) · 7.91 KB
/
node.yaml
File metadata and controls
209 lines (208 loc) · 7.91 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: s3-csi-node
namespace: {{ .Release.Namespace }}
labels:
{{- include "scality-mountpoint-s3-csi-driver.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app: s3-csi-node
{{- include "scality-mountpoint-s3-csi-driver.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: s3-csi-node
{{- include "scality-mountpoint-s3-csi-driver.labels" . | nindent 8 }}
spec:
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.node.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.node.serviceAccount.name }}
priorityClassName: system-node-critical
{{- with .Values.node.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
tolerations:
{{- if .Values.node.tolerateAllTaints }}
- operator: Exists
{{- else if .Values.node.defaultTolerations }}
- key: CriticalAddonsOnly
operator: Exists
- operator: Exists
effect: NoExecute
tolerationSeconds: 300
{{- end }}
{{- with .Values.node.tolerations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: s3-plugin
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (toString .Values.image.tag)) }}
securityContext:
privileged: true
{{- with .Values.node.seLinuxOptions }}
seLinuxOptions:
user: {{ .user }}
type: {{ .type }}
role: {{ .role }}
level: {{ .level }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --endpoint=$(CSI_ENDPOINT)
- --v={{ .Values.node.logLevel }}
env:
- name: CSI_ENDPOINT
value: unix:/csi/csi.sock
- name: KUBELET_PATH
value: {{ .Values.node.kubeletPath }}
- name: CSI_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HOST_PLUGIN_DIR
value: {{ trimSuffix "/" .Values.node.kubeletPath }}/plugins/s3.csi.scality.com/
- name: MOUNTPOINT_NAMESPACE
value: {{ .Values.mountpointPod.namespace }}
- name: AWS_ENDPOINT_URL
value: {{ coalesce .Values.node.s3EndpointUrl .Values.s3.endpointUrl }}
- name: AWS_REGION
value: {{ coalesce .Values.node.s3Region .Values.s3.region }}
{{- with .Values.s3CredentialSecret }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .accessKeyId }}
optional: true
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .secretAccessKey }}
optional: true
- name: AWS_SESSION_TOKEN
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .sessionToken }}
optional: true
{{- end }}
{{- if .Values.tls.caCertSecret }}
# TLS configuration for custom CA certificates in mounter pods
- name: TLS_CA_CERT_SECRET
value: {{ .Values.tls.caCertSecret | quote }}
- name: TLS_INIT_IMAGE
value: {{ printf "%s:%s" .Values.tls.initImage.repository .Values.tls.initImage.tag | quote }}
- name: TLS_INIT_IMAGE_PULL_POLICY
value: {{ .Values.tls.initImage.pullPolicy | quote }}
- name: TLS_INIT_RESOURCES_REQUESTS_CPU
value: {{ .Values.tls.initResources.requests.cpu | quote }}
- name: TLS_INIT_RESOURCES_REQUESTS_MEMORY
value: {{ .Values.tls.initResources.requests.memory | quote }}
- name: TLS_INIT_RESOURCES_LIMITS_MEMORY
value: {{ .Values.tls.initResources.limits.memory | quote }}
{{- end }}
volumeMounts:
- name: kubelet-dir
mountPath: {{ .Values.node.kubeletPath }}
mountPropagation: Bidirectional
- name: plugin-dir
mountPath: /csi
ports:
- name: healthz
containerPort: 9808
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 10
timeoutSeconds: 3
periodSeconds: 2
failureThreshold: 5
{{- with .Values.node.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: node-driver-registrar
image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrar.image.repository .Values.sidecars.nodeDriverRegistrar.image.tag }}
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.sidecars.nodeDriverRegistrar.image.pullPolicy }}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
args:
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: {{ trimSuffix "/" .Values.node.kubeletPath }}/plugins/s3.csi.scality.com/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
livenessProbe:
exec:
command:
- /csi-node-driver-registrar
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --mode=kubelet-registration-probe
initialDelaySeconds: 30
timeoutSeconds: 15
periodSeconds: 90
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
{{- with default .Values.node.resources .Values.sidecars.nodeDriverRegistrar.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: liveness-probe
image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }}
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.sidecars.livenessProbe.image.pullPolicy }}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
args:
- --csi-address=/csi/csi.sock
volumeMounts:
- name: plugin-dir
mountPath: /csi
{{- with default .Values.node.resources .Values.sidecars.livenessProbe.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: kubelet-dir
hostPath:
path: {{ .Values.node.kubeletPath }}
type: Directory
- name: plugin-dir
hostPath:
path: {{ trimSuffix "/" .Values.node.kubeletPath }}/plugins/s3.csi.scality.com/
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: {{ trimSuffix "/" .Values.node.kubeletPath }}/plugins_registry/
type: Directory
{{- with .Values.node.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}