traefik kubernetes crd 健康检查

traefik kubernetes crd health check

我正在使用 Traefik 2.1 和 kubernetes CRD。我的设置与 user guide 非常相似。在我的应用程序中,我在部署上定义了 livenessProbe 和 readinessProbe。我假设 traefik 会将请求路由到 kubernetes 负载均衡器,而 kubernetes 会知道 pod 是否准备就绪。如果 livenessProbe 失败,Kubernetes 也会重启容器。 kubernetes CRD 是否有默认的 healthCheck? Traefik 是使用 kubernetes 服务提供的负载均衡器,还是获取服务下 pods 的 IP 并直接路由到它们?是否建议将 healthCheck 与 Traefik CRD 一起使用?有没有办法不必为 readinessProbe 和 Traefik CRD healthCheck 重复配置?谢谢

Is there a default healthCheck for kubernetes CRD's?

没有

Does Traefik use the load balancer provided by the kubernetes service, or does it get the IP's for the pods underneath the service and route directly to them?

没有。它直接从端点对象获取 IP

Is there a way to not have to repeat the config for the readinessProbe and Traefik CRD healthCheck ?

Traefik 将在发现端点对象没有 IP 时更新其配置,这发生在 liveness/readiness 探测 fails.So 你可以在你的 pods 上配置就绪和活跃探测并期待traefik 确实尊重这一点。

Is there a way to not have to repeat the config for the readinessProbe and Traefik CRD healthCheck

使用 CRD 方法的好处在于其动态性。即使您正在使用 CRD 以及 CRD 提供的健康检查机制,对于 kubernetes 重启 pods 并且不向 [=24] 发送流量,仍然需要 pods 的活跃度和 rediness 探测=] 来自其他 pods,它使用对应于那些 pods.

的 kubernetes 服务