Skip to content

Commit

Permalink
Merge pull request #281 from pohly/deploy-fixes
Browse files Browse the repository at this point in the history
deploy fixes
  • Loading branch information
k8s-ci-robot committed May 4, 2021
2 parents 14ad6d8 + b896e15 commit 6f26590
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 59 deletions.
4 changes: 2 additions & 2 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-attacher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
- key: app.kubernetes.io/instance
operator: In
values:
- csi-hostpathplugin
- hostpath.csi.k8s.io
topologyKey: kubernetes.io/hostname
serviceAccountName: csi-attacher
containers:
Expand Down
23 changes: 0 additions & 23 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
# Service defined here, plus serviceName below in StatefulSet,
# are needed only because of condition explained in
# https://github.com/kubernetes/kubernetes/issues/69608

kind: Service
apiVersion: v1
metadata:
name: csi-hostpathplugin
labels:
app.kubernetes.io/instance: hostpath.csi.k8s.io
app.kubernetes.io/part-of: csi-driver-host-path
app.kubernetes.io/name: csi-hostpathplugin
app.kubernetes.io/component: plugin
spec:
selector:
app.kubernetes.io/instance: hostpath.csi.k8s.io
app.kubernetes.io/part-of: csi-driver-host-path
app.kubernetes.io/name: csi-hostpathplugin
app.kubernetes.io/component: plugin
ports:
- name: dummy
port: 12345
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
- key: app.kubernetes.io/instance
operator: In
values:
- csi-hostpathplugin
- hostpath.csi.k8s.io
topologyKey: kubernetes.io/hostname
serviceAccountName: csi-provisioner
containers:
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-resizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
- key: app.kubernetes.io/instance
operator: In
values:
- csi-hostpathplugin
- hostpath.csi.k8s.io
topologyKey: kubernetes.io/hostname
serviceAccountName: csi-resizer
containers:
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-snapshotter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
- key: app.kubernetes.io/instance
operator: In
values:
- csi-hostpathplugin
- hostpath.csi.k8s.io
topologyKey: kubernetes.io/hostname
serviceAccountName: csi-snapshotter
containers:
Expand Down
4 changes: 2 additions & 2 deletions deploy/kubernetes-1.18/hostpath/csi-hostpath-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
- key: app.kubernetes.io/instance
operator: In
values:
- csi-hostpathplugin
- hostpath.csi.k8s.io
topologyKey: kubernetes.io/hostname
containers:
- name: socat
Expand Down
20 changes: 0 additions & 20 deletions deploy/kubernetes-1.20/hostpath/csi-hostpath-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# Service defined here, plus serviceName below in StatefulSet,
# are needed only because of condition explained in
# https://github.com/kubernetes/kubernetes/issues/69608

kind: Service
apiVersion: v1
metadata:
name: csi-hostpathplugin
labels:
app.kubernetes.io/instance: hostpath.csi.k8s.io
app.kubernetes.io/part-of: csi-driver-host-path
app.kubernetes.io/name: csi-hostpathplugin
app.kubernetes.io/component: plugin
spec:
selector:
app: csi-hostpathplugin
ports:
- name: dummy
port: 12345
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
Expand Down
12 changes: 11 additions & 1 deletion deploy/kubernetes-distributed/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,18 @@ wait_for_daemonset () {
# Wait until the DaemonSet is running on all nodes.
if ! wait_for_daemonset default csi-hostpathplugin; then
echo
echo "driver not ready"
kubectl describe daemonsets/csi-hostpathplugin
echo "Deployment:"
(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)
echo
echo "Pod logs:"
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
for c in $containers; do
echo
(set +e; set -x; kubectl logs $pod $c)
done
done
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: POD_NAMESPACE
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
Expand Down
17 changes: 13 additions & 4 deletions deploy/util/deploy-hostpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,19 @@ expected_running_pods=6
cnt=0
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt ${expected_running_pods} ]; do
if [ $cnt -gt 30 ]; then
echo "$(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) running pods:"
kubectl describe pods
echo >&2 "ERROR: hostpath deployment not ready after over 5min"
echo "Expecting $expected_running_pods, have $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l)."
echo "Deployment:"
(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)
echo
echo "Pod logs:"
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
for c in $containers; do
echo
(set +e; set -x; kubectl logs $pod $c)
done
done
echo
echo "ERROR: hostpath deployment not ready after over 5min"
exit 1
fi
echo $(date +%H:%M:%S) "waiting for hostpath deployment to complete, attempt #$cnt"
Expand Down

0 comments on commit 6f26590

Please sign in to comment.