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
* Add few echo stating what the script is currently doing
* Update sleep durations
* Use [*] and not [0] in the jsonpath when checking the kube-apiserver-operator status because the pod may not exists yet
* Remove /opt/openshift at the end of the installation, it was added
during openshift#6649 and it should
get cleaned up once the installation is complete
* Check if api is available while waiting for kube-apiserver-operator ready status
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
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,15 @@ function signal_bootstrap_complete {
25
25
}
26
26
27
27
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 ];
28
+
echo"Waiting for kube-apiserver-operator"
29
+
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
30
do
31
31
echo"Waiting for kube-apiserver-operator ready condition to be True"
32
+
oc get --raw='/readyz'&> /dev/null ||echo"Api is not available"
32
33
sleep 10
33
34
done
35
+
36
+
echo"Restarting kubelet"
34
37
# daemon-reload is required because /etc/systemd/system/kubelet.service.d/20-nodenet.conf is added after kubelet started
35
38
systemctl daemon-reload
36
39
systemctl restart kubelet
@@ -40,26 +43,31 @@ function restart_kubelet {
40
43
echo"Waiting for kube-apiserver to apply the new static pod configuration"
41
44
sleep 10
42
45
done
46
+
47
+
echo"Restarting kubelet"
43
48
systemctl restart kubelet
44
49
}
45
50
46
51
functionapprove_csr {
47
-
echo"Approving csrs ..."
52
+
echo"Waiting for node to report ready status"
48
53
# use [*] and not [0] in the jsonpath because the node resource may not have been created yet
49
54
until [ "$(oc get nodes --selector='node-role.kubernetes.io/master' -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'| grep -c "True")"-eq 1 ];
50
55
do
51
56
echo"Approving csrs ..."
52
57
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
58
+
sleep 10
54
59
done
60
+
echo"node is ready"
55
61
}
56
62
57
63
functionwait_for_cvo {
58
64
echo"Waiting for cvo"
59
-
until [ "$(oc get clusterversion -o jsonpath='{.items[0].status.conditions[?(@.type=="Available")].status}')"=="True" ];
65
+
until [ "$(oc get clusterversion -o jsonpath='{.items[*].status.conditions[?(@.type=="Available")].status}')"=="True" ];
0 commit comments