GCE Ingress无法从准备就绪调查中获取健康检查 [英] GCE Ingress not picking up health check from readiness probe
本文介绍了GCE Ingress无法从准备就绪调查中获取健康检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我创建GCE入口时,Google Load Balancer不会通过就绪探针设置运行状况检查.根据文档( Ingress GCE健康检查),它应该进行检查. /p>
When I create a GCE ingress, Google Load Balancer does not set the health check from the readiness probe. According to the docs (Ingress GCE health checks) it should pick it up.
在支持服务的Pod上公开一个任意URL,作为准备情况调查.
Expose an arbitrary URL as a readiness probe on the pods backing the Service.
有什么想法吗?
部署:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: frontend-prod
labels:
app: frontend-prod
spec:
selector:
matchLabels:
app: frontend-prod
replicas: 3
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: frontend-prod
spec:
imagePullSecrets:
- name: regcred
containers:
- image: app:latest
readinessProbe:
httpGet:
path: /healthcheck
port: 3000
initialDelaySeconds: 15
periodSeconds: 5
name: frontend-prod-app
- env:
- name: PASSWORD_PROTECT
value: "1"
image: nginx:latest
readinessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 5
periodSeconds: 5
name: frontend-prod-nginx
服务:
Service:
apiVersion: v1
kind: Service
metadata:
name: frontend-prod
labels:
app: frontend-prod
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app: frontend-prod
入口:
Ingress:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: frontend-prod-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: frontend-prod-ip
spec:
tls:
- secretName: testsecret
backend:
serviceName: frontend-prod
servicePort: 80
推荐答案
因此,显然,您需要在PodSpec上包括容器端口. 似乎没有记录在任何地方.
So apparently, you need to include the container port on the PodSpec. Does not seem to be documented anywhere.
例如
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
谢谢布莱恩! https://github.com/kubernetes/ingress-gce/issues/241
这篇关于GCE Ingress无法从准备就绪调查中获取健康检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文