GKE入口错误:服务器遇到临时错误,无法完成您的请求

时间:2019-03-25 13:46:19

标签: google-kubernetes-engine kubernetes-ingress nginx-ingress

我使用Web应用程序在GKE上创建了一个kubernetes集群。最初,此方法运行良好,但是将端口(从80更改为5000)后,出现以下错误:

Error: Server Error
The server encountered a temporary error and could not complete your request.

Please try again in 30 seconds.

此后,我改回了端口(5000至80),但错误仍然存​​在。我认为端口不是真正的问题,因为我看到了许多非80端口的示例。但是,问题可能与负载平衡器详细信息页面提供的运行状况或就绪程度有关:

Name                             Type             Zone     Healthy  Auto-scaling    Balancing mode  Capacity
k8s-ig--93f47ba7de28cdd1    Instance group  europe-west2-a  0 / 1   Off Max. RPS: 1 (per instance)  100%
k8s-ig--93f47ba7de28cdd1    Instance group  europe-west2-b  0 / 1   Off Max. RPS: 1 (per instance)  100%
k8s-ig--93f47ba7de28cdd1    Instance group  europe-west2-c  0 / 1   Off Max. RPS: 1 (per instance)  100%

这些是我的设置:

部署

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: web
  template:
    metadata:
      labels:
        component: web
    spec:
      containers:
      - name: web
        image: web:latest
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 5000
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 5000
        ports:
        - containerPort: 5000

服务:

apiVersion: v1
kind: Service
metadata:
  name: web-cluster-ip-service
spec:
  type: NodePort
  selector:
    component: web
  ports:
    - port: 5000
      targetPort: 5000

入口:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.global-static-ip-name: web-ip
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/add-base-url: "true"
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 5000

at /是登录页面,因此返回200。

0 个答案:

没有答案