aknuds1
aknuds1

Reputation: 68117

Is it possible to health check a Kubernetes API server over HTTP or TCP?

I need to load balance a cluster of Kubernetes API servers (version 1.7) on DigitalOcean, but the problem is that the Kubernetes API server seemingly only supports HTTPS and the DigitalOcean load balancer can only do HTTP or TCP health checks.

Is there any way to perform health checks of the Kubernetes API server either via HTTP or TCP?

Upvotes: 11

Views: 13056

Answers (2)

Prem Dubey
Prem Dubey

Reputation: 71

do a kubectl proxy and then use postman or any tool to send a get request to http://127.0.0.1:8001/healthz/poststarthook/apiservice-status-available-controller

you can use other too

  • /healthz,
  • /healthz/autoregister-completion,
  • /healthz/ping,
  • /healthz/poststarthook/apiservice-registration-controller,
  • /healthz/poststarthook/apiservice-status-available-controller,
  • /healthz/poststarthook/bootstrap-controller,
  • /healthz/poststarthook/ca-registration,
  • /healthz/poststarthook/extensions/third-party-resources,
  • /healthz/poststarthook/generic-apiserver-start-informers,
  • /healthz/poststarthook/kube-apiserver-autoregistration,
  • /healthz/poststarthook/start-apiextensions-controllers,
  • /healthz/poststarthook/start-apiextensions-informers,
  • /healthz/poststarthook/start-kube-aggregator-informers,
  • /healthz/poststarthook/start-kube-apiserver-informers,

Upvotes: 6

vascop
vascop

Reputation: 5222

You can hit API server nodes on port 8080 at /healthz and expect to get back a 200 with a body of ok if the API server is up and in good health.

See some test code that hits this endpoint for more details: https://github.com/kubernetes/kubernetes/blob/fe3e7482764ace362b465405c45780d03a8c6706/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz_test.go#L28

Upvotes: 2

Related Questions