如何快速给pod添加健康检查?
脚本如下 #!/usr/bin/env bash [[ -n $DEBUG ]] && set -x set -eou pipefail useage(){ cat <<HELP USAGE: kubeprobe.sh TYPE WORKLOAD CONTAINER [LIVENESSPROBE READINESSPROBE] eg: kubeprobe deploy ui nginx kubeprobe deploy ui nginx "" "/ 80 3 2 1 1 3" kubeprobe deploy ui nginx "/ 80 10 2 1 1 3" "/ 80 3 2 1 1 3" HELP } exit_err() { echo >&2 "${1}" exit 1 } if [ $# -lt 3 ];then useage exit 1 fi TYPE=$1 WORKLOAD=$2 CONTAINER=$3 LIVENESSPROBE_CONFIG=${4:-""} READINESSPROBE_CONFIG=${5:-""} SPEC='{"spec": {"template": {"spec": {"containers": [{"name": "'${CONTAINER}'"' if [ -n "${LIVENESSPROBE_CONFIG}" ];then