我正在使用 容器探针 检查在 kubernetes pod 中的容器内运行的应用程序的健康状况。现在我的示例 pod 配置看起来像,
"spec":{
"containers":[
{
"image":"tomcat",
"name":"tomcat",
"livenessProbe":{
"httpGet":{
"port": 80
},
"initialDelaySeconds": 15,
"periodSeconds": 10
}
}
]
}
就我而言,我需要监控同一个容器的两个端口。 80 和 443 .但是我找不到在配置文件中为同一个容器提供两个端口的方法。有没有其他方法可以做到这一点?
最佳答案
不可能,尝试将健康检查封装在您的应用程序中
前任:
http://localhost:80/health_check?full =>(代理)=> http://localhost:443/health_check?full
可以帮到您https://github.com/kubernetes/kubernetes/issues/37218
关于kubernetes - 为 kubernetes 探针提供多个健康检查 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43339527/