GKE ingress and GLB health check auto discovery

ismail yenigül
1 min readSep 29, 2021

--

As described here Google Kubernetes Engine (GKE) offers integrated support for two types of Cloud Load Balancing for a publicly accessible application:

  1. Ingress
  2. External Network Load Balancing

For Ingress type, when you specify kind: Ingress in a Kubernetes manifest, you instruct GKE to create an Ingress resource. A GLB load balancer is created with backends and health checks for each backend.
GKE creates a Google Cloud health check, based on the readiness probe settings of the deployment referenced by the GKE Service used in ingress deployment. If you have a service definition in ingress manifest

- host: myhost.example.com
http:
paths:
- backend:
serviceName: my-workload-service
servicePort: 80

an livenessProbe in kind: Deploymentlike the following

livenessProbe:
failureThreshold: 3
httpGet:
path: /health
port: 8080
scheme: HTTP

GKE will create the following health check.

If your deployment does not have a livenessProbe, the request path will be /

If there is nothing to serve in / and if the pod returns 404, then the health check will fail. it means GLB will not handle request for this backend.

So don’t forget to configure livenessProbe

Ismail YENIGUL

Devops Engineer

--

--