我想设置一个活性探针。我正在使用脚本运行curl命令。然而,我可以看到liveness探针失败了,出现了以下错误:
kubectl描述pod<>
警告不健康4m5s(x2超过7m5s)kubelet Liveness
探测失败:OCI运行时执行失败:执行失败:
container_linux.go:380:启动容器进程导致:exec格式
错误:未知
实时性:exec[./livenessprobe.sh]延迟=180秒超时=120秒
周期=180秒#成功=1#失败=2
部署.yaml
livenessProbe:
exec:
command:
- ./livenessprobe.sh
initialDelaySeconds: 180
periodSeconds: 180
timeoutSeconds: 120
failureThreshold: 2
successThreshold: 1
如果我执行到pod中并运行/livessprobe.sh我得到了正确的答案。这只是一个curl命令
./livessprobe.sh
curl --fail -H "Authorization: Basic <redacted>==" -H "Content-Type: application/json" -H "x-geeiq-origin: liveness-probe" -i -X POST -d @livenessprobe-request.json http://0.0.0.0:8080/