Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 729
aknuds1 Avatar asked Nov 02 '17 11:11

aknuds1


Video Answer


2 Answers

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,
like image 96
Prem Dubey Avatar answered Sep 28 '22 11:09

Prem Dubey


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

like image 41
vascop Avatar answered Sep 28 '22 11:09

vascop