Kubernetes 在活动性/就绪性探测中指定httpGet和exec处理程序
在一个容器探测中是否可能有多个处理程序? 差不多Kubernetes 在活动性/就绪性探测中指定httpGet和exec处理程序,kubernetes,Kubernetes,在一个容器探测中是否可能有多个处理程序? 差不多 livenessProbe: { httpGet: { path: "/ping", port: 9099 }, exec: { command: [ "verify-correctness.sh", ] } } 更新: 在Kube 1.6xkubectl时,对这样的配置应用 spec.template.
livenessProbe: {
httpGet: {
path: "/ping",
port: 9099
},
exec: {
command: [
"verify-correctness.sh",
]
}
}
更新: 在Kube 1.6x
kubectl时,对这样的配置应用
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;"
]
}
}
它不受支持
关于这一点,它包含了人们使用的几种变通方法