Kubernetes http livenessProbe是否使用https?
我们有一个http livenessProbe设置Kubernetes http livenessProbe是否使用https?,kubernetes,Kubernetes,我们有一个http livenessProbe设置 livenessProbe: httpGet: path: /admin port: http initialDelaySeconds: 180 periodSeconds: 20 但是为什么在描述中连接是通过https的呢 Liveness probe failed: Get https://10.11.1.7:80/admin: net/http: request canceled wh
livenessProbe:
httpGet:
path: /admin
port: http
initialDelaySeconds: 180
periodSeconds: 20
但是为什么在描述中连接是通过https的呢
Liveness probe failed: Get https://10.11.1.7:80/admin: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Kubernetes正按照您的要求执行操作,探测http url,但您的应用程序pod web服务器正在将其重定向到https,这导致了错误 您可以在pod中修复它,也可以使用
没有重定向。从另一个容器中,我得到一个响应
curl-lhttp://10.11.0.194/admin
。没有理由在probeby默认方案http中使用httpsadd方案:http。在deployment.yamllivenessProbe:FailureUrReshold:3 httpGet:path:/admin端口:80方案:HTTP初始延迟秒:300周期秒:30成功阈值:1 timeoutSeconds:10
10.11.1.7:80和10.11.0.194 IP不同…是吗你使用过nginx或tomcat这样的网络服务器吗?没有。我打错了。这只是另一个有同样问题的容器
apiVersion: v1
kind: Pod
metadata:
name: goproxy
labels:
app: goproxy
spec:
containers:
- name: goproxy
image: k8s.gcr.io/goproxy:0.1
ports:
- containerPort: 8080
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 15
periodSeconds: 20