首页 文章

Kubernetes / GCE Ingress控制器失败

提问于
浏览
1

我尝试使用TLS在Google容器引擎上进行HTTP负载 balancer (使用附带的GCE入口控制器) . 即使在Google's official tutorial之后,我的错误也是可重复的 . 为了便于阅读,我总结了_2762626中的程序:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80

---

apiVersion: v1
kind: Service
metadata:
  name: nginx
  labels:
    name: nginx
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
  selector:
    name: nginx

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: basic-ingress
spec:
  backend:
    serviceName: nginx
    servicePort: 80

然后:

kubectl create -f config.yaml
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services nginx)
gcloud compute firewall-rules create allow-130-211-0-0-22   --source-ranges 130.211.0.0/22   --allow tcp:$NODE_PORT
curl <ip_of_load_balancer>

(我删除了防火墙规则上的标签,因此它将适用于所有标签) .

但是我得到一个 502 Server Erroraccording to the docs意味着它可能会自动引导(但它始终保持这样) . 我可以在控制台上看到后端不 Health .

在文档中,要避免这个需要:

  • 防火墙规则(上面已完成)

  • 服务必须以200响应(但我在本地测试了 nginx 图像,并通过一般的Load Balancer测试服务,工作正常)

那么这个错误的原因是什么?我该如何进一步调试呢?

1 回答

  • 1

    我一夜之间离开了集群,它现在正在运行 . 它似乎需要一些引导程序或Google Cloud端修复的内容 .

相关问题