2

I have read this and I understand (I think) the differences between Kubernetes livenessProbes, and the GKE LoadBalancer health checks.

My problem is this: I am exposing most of my Kube services via NodePort, which by default creates a new Backend Service in GKE, and also creates a load-balancer health check corresponding to that Backend HTTP service in GKE.

All of these automatically-created health checks assume I have a HTTP status endpoint on /, when I do not. I have a HTTP health check hosted on a different endpoint.

How do I

A) Somehow hint to GKE to create loadbalancer rules based off of rules defined in Kubernetes resources, rather than blindly creating a bunch listening on the wrong route, or

B) Get GKE to NOT automatically create an invalid health check for EVERY NodePort service.

Or is this just an inflexible Google Cloud quirk that I will have to make code changes to work around?

2 Answers 2

4

Discovered that the answer is

A. No

B. No

by reading the Kubernetes Ingress Github README.MD:

"..currently we just rely on kubernetes service/pod liveness probes and force pods to have a / endpoint that responds with 200 for GCE."

2
0

Today, you can configure these using backendconfigs. A backendConfig is used to configure how an ingress talks to a service, including telling it how to do a health check.

You'll need to configure the service to use the BackendConfig:

apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: '{"default": "my-backendconfig"}'
...

Then you can configure the healthcheck directly in the backendconfig:

apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
  name: my-backendconfig
spec:
  healthCheck:
    checkIntervalSec: INTERVAL
    timeoutSec: TIMEOUT
    healthyThreshold: HEALTH_THRESHOLD
    unhealthyThreshold: UNHEALTHY_THRESHOLD
    type: PROTOCOL
    requestPath: PATH
    port: PORT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.