GCP负载平衡器后端状态未知 [英] GCP load balancer backend status unknown
问题描述
我很惊讶.
我有一个演出和制作环境.两种环境具有相同的部署,服务,入口,防火墙规则,并且都在/
上提供200
.
I have a staging and production environment. Both environments have the same deployments, services, ingress, firewall rules, and both serve a 200
on /
.
但是,在打开暂存环境并配置相同的入口之后,暂存服务失败,并显示Some backend services are in UNKNOWN state
.生产仍在进行中.
However, after turning on the staging environment and provisioning the same ingress, the staging service fails with Some backend services are in UNKNOWN state
. Production is still live.
GKE上的前端和后端Pod均已准备就绪.我已经手动测试了运行状况检查,当我访问/
时,检查通过了.
Both the frontend and backend pods are ready on GKE. I've manually tested the health checks and they pass when I visit /
.
我看不到指向正确方向的日志或gcp文档.我可能会破坏什么?
I see nothing in the logs or gcp docs pointing in the right direction. What could I have possibly broken?
ingress.yaml
:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: fanout-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "STATIC-IP"
spec:
backend:
serviceName: frontend
servicePort: 8080
tls:
- hosts:
- <DOMAIN>
secretName: staging-tls
rules:
- host: <DOMAIN>
http:
paths:
- path: /*
backend:
serviceName: frontend
servicePort: 8080
- path: /backend/*
backend:
serviceName: backend
servicePort: 8080
frontend.yaml
:
apiVersion: v1
kind: Service
metadata:
labels:
app: frontend
name: frontend
namespace: default
spec:
ports:
- nodePort: 30664
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: frontend
type: NodePort
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
generation: 15
labels:
app: frontend
name: frontend
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
app: frontend
minReadySeconds: 5
template:
metadata:
labels:
app: frontend
spec:
containers:
- image: <our-image>
name: frontend
ports:
- containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 3
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 3
推荐答案
昨天甚至是本指南 https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer
没有用.不知道发生了什么,但甚至等待了30分钟以上,入口正在报告后端的UNKNOWN状态.
didn't work. Don't know what happened but even waiting 30minutes + the ingress was reporting UNKNOWN state for backends .
24小时后,情况似乎好多了. L7 http ingress可以工作,但是报告健康后端的延迟很大.
After 24 hours, things seem to be much better. L7 http ingress works but with big delay on reporting healthy backends.
这篇关于GCP负载平衡器后端状态未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!