在容器探测中有多个处理程序是可能的吗?有点像
livenessProbe: {
httpGet: {
path: "/ping",
port: 9099
},
exec: {
command: [
"verify-correctness.sh",
]
}
}更新:
在Kube1.6x kubectl apply上,这样的配置返回
spec.template.spec.containers[0].livenessProbe.httpGet: Forbidden: may not specify more than 1 handler type所以也许不支持?
更新2:
在阿拉·普利多的回答之后,我将httpGet合并到命令中,如下所示:
"livenessProbe": {
"exec": {
"command": [
"sh",
"-c",
"reply=$(curl -s -o /dev/null -w %{http_code} http://127.0.0.1:9099/ping); if [ \"$reply\" -lt 200 -o \"$reply\" -ge 400 ]; then exit 1; fi; verify-correctness.sh;"
]
}
}发布于 2018-03-13 16:57:37
这是不支持的。
关于这一点有悬而未决的问题,它包含了人们使用的几个解决方案。
https://stackoverflow.com/questions/49260495
复制相似问题