Skip to content

Commit 6f26590

Browse files
authored
Merge pull request #281 from pohly/deploy-fixes
deploy fixes
2 parents 14ad6d8 + b896e15 commit 6f26590

10 files changed

+35
-59
lines changed

deploy/kubernetes-1.18/hostpath/csi-hostpath-attacher.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ spec:
2929
requiredDuringSchedulingIgnoredDuringExecution:
3030
- labelSelector:
3131
matchExpressions:
32-
- key: app.kubernetes.io/name
32+
- key: app.kubernetes.io/instance
3333
operator: In
3434
values:
35-
- csi-hostpathplugin
35+
- hostpath.csi.k8s.io
3636
topologyKey: kubernetes.io/hostname
3737
serviceAccountName: csi-attacher
3838
containers:

deploy/kubernetes-1.18/hostpath/csi-hostpath-plugin.yaml

-23
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
# Service defined here, plus serviceName below in StatefulSet,
2-
# are needed only because of condition explained in
3-
# https://github.com/kubernetes/kubernetes/issues/69608
4-
5-
kind: Service
6-
apiVersion: v1
7-
metadata:
8-
name: csi-hostpathplugin
9-
labels:
10-
app.kubernetes.io/instance: hostpath.csi.k8s.io
11-
app.kubernetes.io/part-of: csi-driver-host-path
12-
app.kubernetes.io/name: csi-hostpathplugin
13-
app.kubernetes.io/component: plugin
14-
spec:
15-
selector:
16-
app.kubernetes.io/instance: hostpath.csi.k8s.io
17-
app.kubernetes.io/part-of: csi-driver-host-path
18-
app.kubernetes.io/name: csi-hostpathplugin
19-
app.kubernetes.io/component: plugin
20-
ports:
21-
- name: dummy
22-
port: 12345
23-
---
241
kind: StatefulSet
252
apiVersion: apps/v1
263
metadata:

deploy/kubernetes-1.18/hostpath/csi-hostpath-provisioner.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ spec:
2929
requiredDuringSchedulingIgnoredDuringExecution:
3030
- labelSelector:
3131
matchExpressions:
32-
- key: app.kubernetes.io/name
32+
- key: app.kubernetes.io/instance
3333
operator: In
3434
values:
35-
- csi-hostpathplugin
35+
- hostpath.csi.k8s.io
3636
topologyKey: kubernetes.io/hostname
3737
serviceAccountName: csi-provisioner
3838
containers:

deploy/kubernetes-1.18/hostpath/csi-hostpath-resizer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ spec:
2929
requiredDuringSchedulingIgnoredDuringExecution:
3030
- labelSelector:
3131
matchExpressions:
32-
- key: app.kubernetes.io/name
32+
- key: app.kubernetes.io/instance
3333
operator: In
3434
values:
35-
- csi-hostpathplugin
35+
- hostpath.csi.k8s.io
3636
topologyKey: kubernetes.io/hostname
3737
serviceAccountName: csi-resizer
3838
containers:

deploy/kubernetes-1.18/hostpath/csi-hostpath-snapshotter.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ spec:
2929
requiredDuringSchedulingIgnoredDuringExecution:
3030
- labelSelector:
3131
matchExpressions:
32-
- key: app.kubernetes.io/name
32+
- key: app.kubernetes.io/instance
3333
operator: In
3434
values:
35-
- csi-hostpathplugin
35+
- hostpath.csi.k8s.io
3636
topologyKey: kubernetes.io/hostname
3737
serviceAccountName: csi-snapshotter
3838
containers:

deploy/kubernetes-1.18/hostpath/csi-hostpath-testing.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ spec:
5757
requiredDuringSchedulingIgnoredDuringExecution:
5858
- labelSelector:
5959
matchExpressions:
60-
- key: app.kubernetes.io/name
60+
- key: app.kubernetes.io/instance
6161
operator: In
6262
values:
63-
- csi-hostpathplugin
63+
- hostpath.csi.k8s.io
6464
topologyKey: kubernetes.io/hostname
6565
containers:
6666
- name: socat

deploy/kubernetes-1.20/hostpath/csi-hostpath-plugin.yaml

-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
# Service defined here, plus serviceName below in StatefulSet,
2-
# are needed only because of condition explained in
3-
# https://github.com/kubernetes/kubernetes/issues/69608
4-
5-
kind: Service
6-
apiVersion: v1
7-
metadata:
8-
name: csi-hostpathplugin
9-
labels:
10-
app.kubernetes.io/instance: hostpath.csi.k8s.io
11-
app.kubernetes.io/part-of: csi-driver-host-path
12-
app.kubernetes.io/name: csi-hostpathplugin
13-
app.kubernetes.io/component: plugin
14-
spec:
15-
selector:
16-
app: csi-hostpathplugin
17-
ports:
18-
- name: dummy
19-
port: 12345
20-
---
211
kind: StatefulSet
222
apiVersion: apps/v1
233
metadata:

deploy/kubernetes-distributed/deploy.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,18 @@ wait_for_daemonset () {
250250
251251
# Wait until the DaemonSet is running on all nodes.
252252
if ! wait_for_daemonset default csi-hostpathplugin; then
253+
echo
253254
echo "driver not ready"
254-
kubectl describe daemonsets/csi-hostpathplugin
255+
echo "Deployment:"
256+
(set +e; set -x; kubectl describe all,role,clusterrole,rolebinding,clusterrolebinding,serviceaccount,storageclass,csidriver --all-namespaces -l app.kubernetes.io/instance=hostpath.csi.k8s.io)
257+
echo
258+
echo "Pod logs:"
259+
kubectl get pods -l app.kubernetes.io/instance=hostpath.csi.k8s.io --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.name}{" "}{range .spec.containers[*]}{.name}{" "}{end}{"\n"}{end}' | while read -r pod containers; do
260+
for c in $containers; do
261+
echo
262+
(set +e; set -x; kubectl logs $pod $c)
263+
done
264+
done
255265
exit 1
256266
fi
257267

deploy/kubernetes-distributed/hostpath/csi-hostpath-plugin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
fieldRef:
4343
apiVersion: v1
4444
fieldPath: spec.nodeName
45-
- name: POD_NAMESPACE
45+
- name: NAMESPACE
4646
valueFrom:
4747
fieldRef:
4848
fieldPath: metadata.namespace

deploy/util/deploy-hostpath.sh

+13-4
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,19 @@ expected_running_pods=6
247247
cnt=0
248248
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt ${expected_running_pods} ]; do
249249
if [ $cnt -gt 30 ]; then
250-
echo "$(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) running pods:"
251-
kubectl describe pods
252-
253-
echo >&2 "ERROR: hostpath deployment not ready after over 5min"
250+
echo "Expecting $expected_running_pods, have $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l)."
251+
echo "Deployment:"
252+
(set +e; set -x; kubectl describe all,role,clusterrole,rolebinding,clusterrolebinding,serviceaccount,storageclass,csidriver --all-namespaces -l app.kubernetes.io/instance=hostpath.csi.k8s.io)
253+
echo
254+
echo "Pod logs:"
255+
kubectl get pods -l app.kubernetes.io/instance=hostpath.csi.k8s.io --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.name}{" "}{range .spec.containers[*]}{.name}{" "}{end}{"\n"}{end}' | while read -r pod containers; do
256+
for c in $containers; do
257+
echo
258+
(set +e; set -x; kubectl logs $pod $c)
259+
done
260+
done
261+
echo
262+
echo "ERROR: hostpath deployment not ready after over 5min"
254263
exit 1
255264
fi
256265
echo $(date +%H:%M:%S) "waiting for hostpath deployment to complete, attempt #$cnt"

0 commit comments

Comments
 (0)