是否可以通过HTTP或TCP对Kubernetes API服务器进行健康检查?

akn*_*ds1 7 load-balancing digital-ocean kubernetes kubernetes-health-check

我需要在DigitalOcean上对Kubernetes API服务器(版本1.7)的集群进行负载平衡,但问题是Kubernetes API服务器似乎只支持HTTPS,而DigitalOcean负载均衡器只能执行HTTP或TCP运行状况检查.

有没有办法通过HTTP或TCP对Kubernetes API服务器进行健康检查?

小智 5

做一个 kubectl 代理,然后使用邮递员或任何工具向http://127.0.0.1:8001/healthz/poststarthook/apiservice-status-available-controller发送获取请求

你也可以使用其他

  • /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,


vas*_*cop 2

您可以在端口 8080 上访问 API 服务器节点,如果 API 服务器已启动且运行状况良好,则/healthz期望返回 200,其正文为。ok

有关更多详细信息,请参阅一些到达此端点的测试代码:https://github.com/kubernetes/kubernetes/blob/fe3e7482764ace362b465405c45780d03a8c6706/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz_test.go#L28