Example and functional requirements
You can start with the following example health check script. Add to it for your use case. In your custom workload health check script, you must define the relevant namespace, deployment, daemonset, and statefulset.
|
|
Choose a name prefix for your application that ensures it runs after the |
Example greenboot health check script
#!/bin/bash
set -e
SCRIPT_NAME=$(basename $0)
# Load the workload health check functions library
source /usr/share/microshift/functions/greenboot.sh
# Stop the script if the user running it is not 'root'
if [ $(id -u) -ne 0 ] ; then
echo "The '${SCRIPT_NAME}' script must be run with the 'root' user privileges"
exit 1
fi
echo "STARTED"
# Set the wait timeout for the current check based on the boot counter
WAIT_TIMEOUT_SECS=$(get_wait_timeout)
/usr/bin/microshift healthcheck -v=2 --timeout="${WAIT_TIMEOUT_SECS}s" --namespace busybox --deployments busybox-deployment
|
|
Functions related to checking workload health previously included in the |