gpt4 book ai didi

kubernetes - GCE Ingress 未从就绪探针中获取健康检查

转载 作者:行者123 更新时间:2023-12-02 11:27:46 25 4
gpt4 key购买 nike

当我创建 GCE 入口时,Google 负载均衡器不会从就绪探针设置运行状况检查。根据文档( Ingress GCE health checks )它应该捡起来。

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

服务:
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

入口:
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 上包含容器端口。
似乎没有任何地方记录。

例如

    spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80

谢谢布赖恩! https://github.com/kubernetes/ingress-gce/issues/241

关于kubernetes - GCE Ingress 未从就绪探针中获取健康检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50018193/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com