|
6 | 6 | [id="microshift-greenboot-how-workload-health-check-scripts-work_{context}"]
|
7 | 7 | = How workload health check scripts work
|
8 | 8 |
|
9 |
| -The workload or application health check script described in this tutorial uses the {microshift-short} health check functions that are available in the `/usr/share/microshift/functions/greenboot.sh` file. This enables you to reuse procedures already implemented for the {microshift-short} core services. |
| 9 | +The workload or application health check script described in this tutorial uses the {microshift-short} health check functions already implemented for the {microshift-short} core services. This enables you to reuse those procedures as a convenience for checking your own workloads. |
10 | 10 |
|
11 | 11 | The script starts by running checks that the basic functions of the workload are operating as expected. To run the script successfully:
|
12 | 12 |
|
13 | 13 | * Execute the script from a root user account.
|
14 | 14 | * Enable the {microshift-short} service.
|
15 | 15 |
|
16 |
| -The health check performs the following actions: |
| 16 | +The `microshift healthcheck` command checks whether a workload of the provided type exists and verifies its |
| 17 | +status for the specified timeout duration. The number of ready replicas, that is, pods, must match the expected amount. |
17 | 18 |
|
18 |
| -* Gets a wait timeout of the current boot cycle for the `wait_for` function. |
19 |
| -* Calls the `namespace_images_downloaded` function to wait until pod images are available. |
20 |
| -* Calls the `namespace_pods_ready` function to wait until pods are ready. |
21 |
| -* Calls the `namespace_pods_not_restarting` function to verify pods are not restarting. |
| 19 | +You can add the following actions to the `microshift healthcheck` command: |
| 20 | + |
| 21 | +* `-v=2` to increase verbosity of the output |
| 22 | +* `--timeout="${WAIT_TIMEOUT_SECS}s"` to override default 300s timeout value |
| 23 | +* `--namespace busybox` to specify the Namespace of the workloads |
| 24 | +* `--deployments busybox-deployment` to specify Deployment to check the readiness of |
| 25 | +
|
| 26 | +The `microshift healthcheck` command also accepts the following additional parameters to specify other kinds |
| 27 | +of workloads: |
| 28 | + |
| 29 | +*`--daemonsets` |
| 30 | +* `--statefulsets` |
| 31 | +
|
| 32 | +These options take a comma-delimited list of resources, for example, `--daemonsets ovnkube-master,ovnkube-node`. |
| 33 | +
|
| 34 | +Alternatively, a `--custom` option can be used with a `JSON` string, for example: |
| 35 | ++ |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +$ microshift healthcheck --custom '{"openshift-storage":{"deployments": ["lvms-operator"], "daemonsets": ["vg-manager"]}, "openshift-ovn-kubernetes":{"daemonsets": ["ovnkube-master", "ovnkube-node"]}}' |
| 39 | +---- |
22 | 40 |
|
23 | 41 | [NOTE]
|
24 | 42 | ====
|
|
0 commit comments