首页 文章

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

提问于
浏览
5

我需要在DigitalOcean上对一组Kubernetes API服务器(版本1.7)进行负载 balancer ,但问题是Kubernetes API服务器似乎只支持HTTPS而且DigitalOcean负载均衡器只能执行HTTP or TCP health checks .

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

2 回答

  • -1

    您可以在 /healthz 上的端口8080上命中API服务器节点,并且如果API服务器已启动并且状况良好,则期望返回带有 ok 主体的200 .

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

  • 2

    做一个kubectl代理,然后使用postman或任何工具发送一个get请求到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

相关问题