Skip to content

Commit 5ea80d0

Browse files
authored
Merge pull request #15829 from denisok/master
update CSI driver, enable multi-node
2 parents 8848aad + a1a8b7d commit 5ea80d0

18 files changed

+324
-369
lines changed

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-attacher.yaml.tmpl

+3-13
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,15 @@ spec:
3838
replicas: 1
3939
selector:
4040
matchLabels:
41-
app: csi-hostpath-attacher
41+
app.kubernetes.io/name: csi-hostpath-attacher
4242
template:
4343
metadata:
4444
labels:
45-
app: csi-hostpath-attacher
45+
app.kubernetes.io/name: csi-hostpath-attacher
4646
addonmanager.kubernetes.io/mode: Reconcile
4747
kubernetes.io/minikube-addons: csi-hostpath-driver
4848
spec:
49-
affinity:
50-
podAffinity:
51-
requiredDuringSchedulingIgnoredDuringExecution:
52-
- labelSelector:
53-
matchExpressions:
54-
- key: app
55-
operator: In
56-
values:
57-
- csi-hostpathplugin
58-
topologyKey: kubernetes.io/hostname
59-
serviceAccountName: csi-attacher
49+
serviceAccount: csi-attacher
6050
containers:
6151
- name: csi-attacher
6252
image: {{.CustomRegistries.Attacher | default .ImageRepository | default .Registries.Attacher }}{{.Images.Attacher}}

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-driverinfo.yaml.tmpl

+6
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ spec:
2727
# To determine at runtime which mode a volume uses, pod info and its
2828
# "csi.storage.k8s.io/ephemeral" entry are needed.
2929
podInfoOnMount: true
30+
# No attacher needed.
31+
attachRequired: false
32+
storageCapacity: true
33+
# Kubernetes may use fsGroup to change permissions and ownership
34+
# of the volume to match user requested fsGroup in the pod's SecurityPolicy
35+
fsGroupPolicy: File

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-plugin.yaml.tmpl

+70-41
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,37 @@
1616
# are needed only because of condition explained in
1717
# https://github.com/kubernetes/kubernetes/issues/69608
1818

19-
kind: Service
20-
apiVersion: v1
21-
metadata:
22-
name: csi-hostpathplugin
23-
namespace: kube-system
24-
labels:
25-
app: csi-hostpathplugin
26-
addonmanager.kubernetes.io/mode: Reconcile
27-
spec:
28-
selector:
29-
app: csi-hostpathplugin
30-
ports:
31-
- name: dummy
32-
port: 12345
33-
---
34-
kind: StatefulSet
19+
kind: DaemonSet
3520
apiVersion: apps/v1
3621
metadata:
3722
name: csi-hostpathplugin
3823
namespace: kube-system
3924
labels:
25+
app.kubernetes.io/instance: hostpath.csi.k8s.io
26+
app.kubernetes.io/part-of: csi-driver-host-path
27+
app.kubernetes.io/name: csi-hostpathplugin
28+
app.kubernetes.io/component: plugin
4029
addonmanager.kubernetes.io/mode: Reconcile
4130
spec:
42-
serviceName: "csi-hostpathplugin"
43-
# One replica only:
44-
# Host path driver only works when everything runs
45-
# on a single node. We achieve that by starting it once and then
46-
# co-locate all other pods via inter-pod affinity
47-
replicas: 1
4831
selector:
4932
matchLabels:
50-
app: csi-hostpathplugin
33+
app.kubernetes.io/instance: hostpath.csi.k8s.io
34+
app.kubernetes.io/part-of: csi-driver-host-path
35+
app.kubernetes.io/name: csi-hostpathplugin
36+
app.kubernetes.io/component: plugin
5137
addonmanager.kubernetes.io/mode: Reconcile
5238
template:
5339
metadata:
5440
labels:
55-
app: csi-hostpathplugin
41+
app.kubernetes.io/instance: hostpath.csi.k8s.io
42+
app.kubernetes.io/part-of: csi-driver-host-path
43+
app.kubernetes.io/name: csi-hostpathplugin
44+
app.kubernetes.io/component: plugin
5645
addonmanager.kubernetes.io/mode: Reconcile
5746
kubernetes.io/minikube-addons: csi-hostpath-driver
5847
spec:
59-
serviceAccount: csi-external-health-monitor-controller
48+
serviceAccount: csi-hostpathplugin-sa
6049
containers:
61-
- name: csi-external-health-monitor-agent
62-
image: {{.CustomRegistries.HostMonitorAgent | default .ImageRepository | default .Registries.HostMonitorAgent }}{{.Images.HostMonitorAgent}}
63-
args:
64-
- "--v=5"
65-
- "--csi-address=$(ADDRESS)"
66-
env:
67-
- name: NODE_NAME
68-
valueFrom:
69-
fieldRef:
70-
fieldPath: spec.nodeName
71-
- name: ADDRESS
72-
value: /csi/csi.sock
73-
imagePullPolicy: "IfNotPresent"
74-
volumeMounts:
75-
- name: socket-dir
76-
mountPath: /csi
7750
- name: csi-external-health-monitor-controller
7851
image: {{.CustomRegistries.HostMonitorController | default .ImageRepository | default .Registries.HostMonitorController }}{{.Images.HostMonitorController}}
7952
args:
@@ -163,6 +136,62 @@ spec:
163136
- --csi-address=/csi/csi.sock
164137
- --health-port=9898
165138

139+
- name: csi-provisioner
140+
image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0
141+
args:
142+
- -v=5
143+
- --csi-address=/csi/csi.sock
144+
- --feature-gates=Topology=true
145+
- --enable-capacity
146+
- --capacity-ownerref-level=0 # pod is owner
147+
- --node-deployment=true
148+
- --strict-topology=true
149+
- --immediate-topology=false
150+
- --worker-threads=5
151+
env:
152+
- name: NODE_NAME
153+
valueFrom:
154+
fieldRef:
155+
apiVersion: v1
156+
fieldPath: spec.nodeName
157+
- name: NAMESPACE
158+
valueFrom:
159+
fieldRef:
160+
fieldPath: metadata.namespace
161+
- name: POD_NAME
162+
valueFrom:
163+
fieldRef:
164+
fieldPath: metadata.name
165+
securityContext:
166+
# This is necessary only for systems with SELinux, where
167+
# non-privileged sidecar containers cannot access unix domain socket
168+
# created by privileged CSI driver container.
169+
privileged: true
170+
volumeMounts:
171+
- mountPath: /csi
172+
name: socket-dir
173+
174+
- name: csi-snapshotter
175+
image: {{.CustomRegistries.Snapshotter | default .ImageRepository | default .Registries.Snapshotter }}{{.Images.Snapshotter}}
176+
args:
177+
- -v=5
178+
- --csi-address=/csi/csi.sock
179+
- --node-deployment
180+
env:
181+
- name: NODE_NAME
182+
valueFrom:
183+
fieldRef:
184+
apiVersion: v1
185+
fieldPath: spec.nodeName
186+
securityContext:
187+
# This is necessary only for systems with SELinux, where
188+
# non-privileged sidecar containers cannot access unix domain socket
189+
# created by privileged CSI driver container.
190+
privileged: true
191+
volumeMounts:
192+
- mountPath: /csi
193+
name: socket-dir
194+
166195
volumes:
167196
- hostPath:
168197
path: /var/lib/kubelet/plugins/csi-hostpath

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-provisioner.yaml.tmpl

-81
This file was deleted.

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-resizer.yaml.tmpl

+3-13
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,15 @@ spec:
4040
replicas: 1
4141
selector:
4242
matchLabels:
43-
app: csi-hostpath-resizer
43+
app.kubernetes.io/name: csi-hostpath-resizer
4444
template:
4545
metadata:
4646
labels:
47-
app: csi-hostpath-resizer
47+
app.kubernetes.io/name: csi-hostpath-resizer
4848
addonmanager.kubernetes.io/mode: Reconcile
4949
kubernetes.io/minikube-addons: csi-hostpath-driver
5050
spec:
51-
affinity:
52-
podAffinity:
53-
requiredDuringSchedulingIgnoredDuringExecution:
54-
- labelSelector:
55-
matchExpressions:
56-
- key: app
57-
operator: In
58-
values:
59-
- csi-hostpathplugin
60-
topologyKey: kubernetes.io/hostname
61-
serviceAccountName: csi-resizer
51+
serviceAccount: csi-resizer
6252
containers:
6353
- name: csi-resizer
6454
image: {{.CustomRegistries.Resizer | default .ImageRepository | default .Registries.Resizer }}{{.Images.Resizer}}

Diff for: deploy/addons/csi-hostpath-driver/deploy/csi-hostpath-snapshotter.yaml.tmpl

-81
This file was deleted.

0 commit comments

Comments
 (0)