[英]Google cloud kubernetes load balancer, health check on the backend isn't working
I am duplicating a Kubernetes cluster containing divolte from one GCP (Google Cloud Platform) project to another. 我正在将一个包含Divolte的Kubernetes集群从一个GCP(Google Cloud Platform)项目复制到另一个项目。 I have the exact same configurations in the already running project as the target project.
在已经运行的项目中,我与目标项目具有完全相同的配置。 In my new project I don't get load balancer running with the right health check and when I try to connect to te static IP form the load balancer I get a 502 server error.
在我的新项目中,我没有使用正确的运行状况检查来运行负载平衡器,并且当我尝试从负载平衡器连接到静态IP时,出现了502服务器错误。
I've followed the same steps as in the original project: 我遵循与原始项目相同的步骤:
Deployment file: 部署文件:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: divolte
spec:
selector:
matchLabels:
app: divolte
replicas: 2
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: divolte
spec:
containers:
- name: divolte
imagePullPolicy: Always
image: "eu.gcr.io/project-name/divolte-collector:latest"
ports:
- containerPort: 8290
env:
- name: JAVA_OPTS
value: "-Xms512m -Xmx2048m -XX:+UseG1GC -Djava.awt.headless=true"
resources:
limits:
cpu: 1
memory: 3072Mi
requests:
cpu: 1
memory: 2048Mi
livenessProbe:
httpGet:
path: /divolte.js
port: 8290
initialDelaySeconds: 22
timeoutSeconds: 1
readinessProbe:
httpGet:
path: /ping
port: 8290
initialDelaySeconds: 22
periodSeconds: 1
terminationGracePeriodSeconds: 30
Service file: 服务文件:
apiVersion: v1
kind: Service
metadata:
name: divolte
spec:
ports:
- name: http
port: 80
targetPort: 8290
nodePort: 30964
selector:
app: divolte
type: NodePort
Ingress file: 入口文件:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: divolte
annotations:
kubernetes.io/ingress.global-static-ip-name: ip-name-here
spec:
tls:
- secretName: ssl-cert-name-here
backend:
serviceName: divolte
servicePort: 80
I expected that the load balancer would pick up the configuration file as in my previous GCP project and would reroute the traffic to the cluster correctly, but I cannot get my GCP load balancer with the health check to work. 我希望负载平衡器能够像我以前的GCP项目一样拾取配置文件,并将流量正确地重新路由到群集,但是我无法通过运行状况检查使GCP负载平衡器正常工作。 Any ideas what to do next?
任何想法下一步该怎么做?
I have found the solution to the problem. 我已经找到解决问题的方法。
Thanks for the suggestions, I was looking to a sympton in the load balancer, but it was the wrong direction. 感谢您的建议,我一直在寻找负载均衡器中的症状,但这是错误的方向。
The kubernetes pods were stuck in a "crashloopbackoff" because I forgot to create a Google Storage bucket, it wasn't in my documentation to setup the environment so I overlooked it. kubernetes吊舱卡在“ crashloopbackoff”中,因为我忘了创建Google存储桶,但我的文档中没有设置环境,因此我忽略了它。 I found it with the "kubectl logs" command.
我用“ kubectl日志”命令找到了它。 The app is up and running now.
该应用程序已启动并正在运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.