forked from openshift/azure-disk-csi-driver-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.yaml
222 lines (222 loc) · 7.39 KB
/
node.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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: azure-disk-csi-driver-node
namespace: openshift-cluster-csi-drivers
annotations:
config.openshift.io/inject-proxy: csi-driver
config.openshift.io/inject-proxy-cabundle: csi-driver
spec:
selector:
matchLabels:
app: azure-disk-csi-driver-node
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 10%
template:
metadata:
labels:
app: azure-disk-csi-driver-node
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
spec:
hostNetwork: true
serviceAccount: azure-disk-csi-driver-node-sa
priorityClassName: system-node-critical
tolerations:
- operator: Exists
nodeSelector:
kubernetes.io/os: linux
initContainers:
# Merge /etc/kubernetes/cloud.conf (on the host) with secret "azure-disk-credentials" into "merged-cloud-config" emptydir.
- name: azure-inject-credentials
image: ${CLUSTER_CLOUD_CONTROLLER_MANAGER_OPERATOR_IMAGE}
command:
- /azure-config-credentials-injector
args:
- --cloud-config-file-path=/etc/cloud-config/cloud.conf
- --output-file-path=/etc/merged-cloud-config/cloud.conf
# Force disable node's managed identity, azure-disk-credentials Secret should be used.
- --disable-identity-extension-auth
- --enable-azure-workload-identity=${ENABLE_AZURE_WORKLOAD_IDENTITY}
env:
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: azure-disk-credentials
key: azure_client_id
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: azure-disk-credentials
key: azure_client_secret
optional: true
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: azure-disk-credentials
key: azure_tenant_id
optional: true
- name: AZURE_FEDERATED_TOKEN_FILE
valueFrom:
secretKeyRef:
name: azure-disk-credentials
key: azure_federated_token_file
optional: true
volumeMounts:
- name: host-cloud-config
mountPath: /etc/cloud-config
readOnly: true
- name: merged-cloud-config
mountPath: /etc/merged-cloud-config
containers:
- name: csi-driver
securityContext:
privileged: true
image: ${DRIVER_IMAGE}
imagePullPolicy: IfNotPresent
args:
- --endpoint=$(CSI_ENDPOINT)
- --logtostderr
- --v=${LOG_LEVEL}
- --nodeid=$(KUBE_NODE_NAME)
# Set localhost port to avoid exposing to whole
# network. We don't scrape metrics on node
- --metrics-address=localhost:8206
# Use credentials provided by the azure-inject-credentials container
- --cloud-config-secret-name=""
- --cloud-config-secret-namespace=""
env:
- name: AZURE_CREDENTIAL_FILE
value: "/etc/kubernetes/cloud.conf"
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/kubelet/
mountPropagation: Bidirectional
name: mountpoint-dir
- mountPath: /etc/kubernetes/
readOnly: true
name: merged-cloud-config
- mountPath: /var/lib/waagent/ManagedIdentity-Settings
readOnly: true
name: msi
- mountPath: /dev
name: device-dir
- mountPath: /sys/bus/scsi/devices
name: sys-devices-dir
- mountPath: /sys/class/scsi_host/
name: scsi-host-dir
- name: etc-selinux
mountPath: /etc/selinux
- name: sys-fs
mountPath: /sys/fs
ports:
- name: healthz
# Due to hostNetwork, this port is open on all nodes!
containerPort: 10300
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 10
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 5
resources:
requests:
memory: 50Mi
cpu: 10m
- name: csi-node-driver-registrar
securityContext:
privileged: true
image: ${NODE_DRIVER_REGISTRAR_IMAGE}
imagePullPolicy: IfNotPresent
args:
- --csi-address=$(ADDRESS)
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
- --v=${LOG_LEVEL}
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/disk.csi.azure.com-reg.sock /csi/csi.sock"]
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/disk.csi.azure.com/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
resources:
requests:
memory: 50Mi
cpu: 10m
- name: csi-liveness-probe
image: ${LIVENESS_PROBE_IMAGE}
imagePullPolicy: IfNotPresent
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --health-port=10300
- --v=${LOG_LEVEL}
volumeMounts:
- name: socket-dir
mountPath: /csi
resources:
requests:
memory: 50Mi
cpu: 10m
volumes:
- hostPath:
path: /var/lib/kubelet/plugins/disk.csi.azure.com
type: DirectoryOrCreate
name: socket-dir
- hostPath:
path: /var/lib/kubelet/
type: DirectoryOrCreate
name: mountpoint-dir
- hostPath:
path: /var/lib/kubelet/plugins_registry/
type: DirectoryOrCreate
name: registration-dir
- hostPath:
path: /etc/kubernetes/
type: Directory
name: host-cloud-config
- hostPath:
path: /var/lib/waagent/ManagedIdentity-Settings
name: msi
- hostPath:
path: /dev
type: Directory
name: device-dir
- hostPath:
path: /sys/bus/scsi/devices
type: Directory
name: sys-devices-dir
- hostPath:
path: /sys/class/scsi_host/
type: Directory
name: scsi-host-dir
- name: merged-cloud-config
emptydir:
- name: etc-selinux
hostPath:
path: /etc/selinux
type: DirectoryOrCreate
- name: sys-fs
hostPath:
path: /sys/fs
type: Directory