Kubernetes: Health checks for external Endpoints Services

258 Views Asked by At

I have created a Service with a static Endpoint that points to two public IP addresses (A.B.C.D and X.Y.V.Z).

apiVersion: v1
kind: Service
metadata:
  name: web-app
spec:
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
---
apiVersion: v1
kind: Endpoints
metadata:
  name: web-app
subsets:
  - addresses:
      - ip: A.B.C.D
      - ip: X.Y.V.Z
    ports:
      - port: 80

Is there a health check for these IP addresses by default, what if one of the IP addresses goes down?
If there is no pre-built health check, how do I configure it?

1

There are 1 best solutions below

0
Kranthiveer Dontineni On

As per this feature request in official kubernetes repo and the comment written by Vllry,

Only ready pods have an endpoint added to the Endpoints object (there is no concept of health checks at the service/endpoint level). This allows consumers of endpoints to avoid the need to health check. So I'm afraid this would be an out-of-scope feature request.

Kubernetes doesn’t have built-in functionality to monitor the endpoints. If you need to monitor these endpoints you can use some other tools like servicemesh or external monitoring tools.