You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/data/bootstrap/bootstrap-in-place/files/opt/openshift/bootstrap-in-place/bootstrap-in-place-post-reboot.sh
+33-6Lines changed: 33 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,33 @@ function signal_bootstrap_complete {
24
24
done
25
25
}
26
26
27
+
functionrelease_cvo_lease {
28
+
if [ !-f /opt/openshift/release_cvo_lease.done ]
29
+
then
30
+
until [ "$(oc get leases -n openshift-cluster-version version | grep -c "version")"-eq 0 ];
31
+
do
32
+
echo"Deleting openshift-cluster-version version lease"
33
+
oc delete leases -n openshift-cluster-version version || sleep 5
34
+
done
35
+
until [ "$(oc get cm -n openshift-cluster-version version | grep -c "version")"-eq 0 ];
36
+
do
37
+
echo"Deleting openshift-cluster-version version cm"
38
+
oc delete cm -n openshift-cluster-version version || sleep 5
39
+
done
40
+
touch /opt/openshift/expedite_bootstrapping.done
41
+
fi
42
+
}
43
+
27
44
functionrestart_kubelet {
28
-
echo"Restarting kubelet"
29
-
until [ "$(oc get pod -n openshift-kube-apiserver-operator --selector='app=kube-apiserver-operator' -o jsonpath='{.items[0].status.conditions[?(@.type=="Ready")].status}'| grep -c "True")"-eq 1 ];
45
+
echo"Waiting for kube-apiserver-operator"
46
+
until [ "$(oc get pod -n openshift-kube-apiserver-operator --selector='app=kube-apiserver-operator' -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'| grep -c "True")"-eq 1 ];
30
47
do
31
48
echo"Waiting for kube-apiserver-operator ready condition to be True"
49
+
oc get --raw='/readyz'&> /dev/null ||echo"Api is not available"
32
50
sleep 10
33
51
done
52
+
53
+
echo"Restarting kubelet"
34
54
# daemon-reload is required because /etc/systemd/system/kubelet.service.d/20-nodenet.conf is added after kubelet started
35
55
systemctl daemon-reload
36
56
systemctl restart kubelet
@@ -40,26 +60,31 @@ function restart_kubelet {
40
60
echo"Waiting for kube-apiserver to apply the new static pod configuration"
41
61
sleep 10
42
62
done
63
+
64
+
echo"Restarting kubelet"
43
65
systemctl restart kubelet
44
66
}
45
67
46
68
functionapprove_csr {
47
-
echo"Approving csrs ..."
69
+
echo"Waiting for node to report ready status"
48
70
# use [*] and not [0] in the jsonpath because the node resource may not have been created yet
49
71
until [ "$(oc get nodes --selector='node-role.kubernetes.io/master' -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'| grep -c "True")"-eq 1 ];
50
72
do
51
73
echo"Approving csrs ..."
52
74
oc get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}'| xargs --no-run-if-empty oc adm certificate approve &> /dev/null ||true
53
-
sleep 30
75
+
sleep 10
54
76
done
77
+
echo"node is ready"
55
78
}
56
79
57
80
functionwait_for_cvo {
58
81
echo"Waiting for cvo"
59
-
until [ "$(oc get clusterversion -o jsonpath='{.items[0].status.conditions[?(@.type=="Available")].status}')"=="True" ];
82
+
until [ "$(oc get clusterversion -o jsonpath='{.items[*].status.conditions[?(@.type=="Available")].status}')"=="True" ];
0 commit comments