GKE Ingress error: The server encountered a temporary error and could not complete your request

3/25/2019

I created a kubernetes cluster on GKE with a web app. This worked fine initially, but after changing a port (from 80 to 5000) it gave the following error:

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

Please try again in 30 seconds.

After this, I changed back the port (5000 to 80), but the error remained. I don't think the port is the actually issue as I have seen a number of examples with non port 80 ports. However, the issue is probably something with the health or readiness as the Load balancer details page gives:

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%

These are my settings:

Deployment

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

Service:

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

Ingress:

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 / is the landing page, so this returns a 200.

-- Mike
google-kubernetes-engine
kubernetes-ingress
nginx-ingress

0 Answers