@@ -46,25 +46,30 @@ sudo journalctl -o cat -u greenboot-healthcheck.service
46
46
47
47
### Health Check Implementation
48
48
49
- The script utilizes the MicroShift health check functions that are available
50
- in the ` /usr/share/microshift/functions/greenboot.sh ` file to reuse procedures
51
- already implemented for the MicroShift core services. These functions need a
52
- definition of the user workload namespaces and the expected count of pods.
53
-
54
- ``` bash
55
- PODS_NS_LIST=(busybox)
56
- PODS_CT_LIST=(1 )
57
- ```
49
+ The script utilizes the MicroShift ` healthcheck ` command that is part of the
50
+ ` microshift ` binary to reuse procedures already implemented for the MicroShift
51
+ core services.
58
52
59
53
The script starts by running sanity checks to verify that it is executed from
60
- the ` root ` account and that the MicroShift service is enabled.
61
-
62
- Finally, the MicroShift health check functions are called to perform the
63
- following actions:
64
- - Get a wait timeout of the current boot cycle for the ` wait_for ` function
65
- - Call the ` namespace_images_downloaded ` function to wait until pod images are available
66
- - Call the ` namespace_pods_ready ` function to wait until pods are ready
67
- - Call the ` namespace_pods_not_restarting ` function to verify pods are not restarting
54
+ the ` root ` account.
55
+
56
+ Then, it executes ` microshift healthcheck ` command with following options:
57
+ - ` -v=2 ` to increase verbosity of the output
58
+ - ` --timeout="${WAIT_TIMEOUT_SECS}s" ` to override default 300s timeout value
59
+ - ` --namespace busybox ` to specify the Namespace of the workloads
60
+ - ` --deployments busybox-deployment ` to specify Deployment to check the readiness of
61
+
62
+ Internally, ` microshift healthcheck ` checks if workload of the provided type exists and verifies its
63
+ status for the specified timeout duration, so the amount of ready replicas (Pods) matches the expected amount.
64
+
65
+ ` microshift healthcheck ` also accepts other parameters to specify other kinds
66
+ of workload: ` --daemonsets ` and ` --statefulsets ` . These options take
67
+ comma-delimited list of resources, e.g.: ` --daemonsets ovnkube-master,ovnkube-node ` .
68
+
69
+ Alternatively, a ` --custom ` option can be used with a JSON string, for example:
70
+ ```
71
+ microshift healthcheck --custom '{"openshift-storage":{"deployments": ["lvms-operator"], "daemonsets": ["vg-manager"]}, "openshift-ovn-kubernetes":{"daemonsets": ["ovnkube-master", "ovnkube-node"]}}'
72
+ ```
68
73
69
74
## MicroShift Service Failure
70
75
0 commit comments