第5章 Greenboot workload health check scripts
Greenboot health check scripts are helpful on edge devices where direct serviceability is either limited or non-existent. You can create health check scripts to assess the health of your workloads and applications. These additional health check scripts are useful components of software problem checks and automatic system rollbacks.
A MicroShift health check script is included in the microshift-greenboot RPM. You can also create your own health check scripts based on the workloads you are running. For example, you can write one that verifies that a service has started.
5.1. How workload health check scripts work リンクのコピーリンクがクリップボードにコピーされました!
The workload or application health check script described in this tutorial uses the MicroShift 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 core services.
The script starts by running checks that the basic functions of the workload are operating as expected. To run the script successfully:
- Execute the script from a root user account.
- Enable the MicroShift service.
The health check performs the following actions:
-
Gets a wait timeout of the current boot cycle for the
wait_forfunction. -
Calls the
namespace_images_downloadedfunction to wait until pod images are available. -
Calls the
namespace_pods_readyfunction to wait until pods are ready. -
Calls the
namespace_pods_not_restartingfunction to verify pods are not restarting.
Restarting pods can indicate a crash loop.