简体   繁体   English

是否在就绪探测失败后重试 Pod

[英]Is probing of a Pod retried after a readiness probe fails

readinessProbe: Indicates whether the container is ready to respond to requests. readinessProbe:指示容器是否准备好响应请求。 If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod.如果就绪探测失败,端点 controller 从与 Pod 匹配的所有服务的端点中删除 Pod 的 IP 地址。 The default state of readiness before the initial delay is Failure.初始延迟前准备就绪的默认 state 是失败。 If a Container does not provide a readiness probe, the default state is Success如果 Container 不提供就绪探测,则默认 state 为 Success

If the readiness probe fails (and the Pod's IP address is removed from end point), what happens next?如果就绪探测失败(并且 Pod 的 IP 地址从端点中删除),接下来会发生什么? Will the Pod's readiness probe conditions be checked again?是否会再次检查 Pod 的就绪探测条件? Will it check again after initial delay?它会在初始延迟后再次检查吗? Is there any chance the Pod's IP address is added to the end point again (if the Pod self healed after readiness probe fails)? Pod 的 IP 地址是否有机会再次添加到端点(如果 Pod 在就绪探测失败后自我修复)? Will that Pod receive traffic again incase if it's healed?如果 Pod 痊愈了,它会再次接收流量吗?

will the pod's readiness prob conditions checked again?会再次检查吊舱的就绪概率条件吗?

yes, the condition will be checked again depends on the threshold you have set.是的,将根据您设置的阈值再次检查条件。

On each periodSeconds configuration readiness will be checked for POD.在每个periodSeconds将检查 POD 的配置准备情况。

will it check again after the initial delay?它会在最初的延迟后再次检查吗?

It will check after the Initial delay only.它将仅在初始延迟后检查。 Initial delay comes into the picture when POD is initializing or starting. POD 初始化或启动时会出现初始延迟。 readiness check will wait for configured time and after that time it will start checking the readiness of POD on each time interval suppose every 5 second or 10 seconds depends on the configuration of the periodSeconds .就绪检查将等待配置的时间,然后在每个时间间隔开始检查 POD 的就绪情况,假设每5秒或10秒取决于periodSeconds的配置。

are there any chance pod's ip address added to the end point again(if pod self healed after readiness probe fails)? pod的ip地址是否有机会再次添加到端点(如果pod在就绪探测失败后自我修复)?

Yes if get auto healed mean, successThreshold set to 1 time if POD give 200 one time it will marked as heal and running pod is this case POD will get the traffic again.是的,如果获得自动修复意味着,如果 POD 给出 200 一次,则成功successThreshold值设置为1次,它将标记为修复,并且正在运行 pod,在这种情况下,POD 将再次获得流量。

will the pod ever receive traffic again incase if it's healed? pod 是否会再次收到流量,以防万一它被治愈?

Yes是的

For example:例如:

readinessProbe:
            httpGet:
              path: /k8/readiness
              port: 9595
            initialDelaySeconds: 25
            periodSeconds: 8
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 30
        livenessProbe:
            httpGet:
              path: /k8/liveness
              port: 9595
            initialDelaySeconds: 30
            periodSeconds: 8
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 30

The readiness and liveness probe will check the status on HTTP endpoint as mentioned in configuration.如配置中所述,就绪和活跃度探针将检查 HTTP 端点上的状态。

initialDelaySeconds : it will only come into the picture when your POD initializing or starting again due to restart or anything. initialDelaySeconds :它只会在您的 POD 初始化或由于重新启动或其他任何原因重新启动时出现。 So when POD is starting readiness wont check service status till 30 second.因此,当 POD 开始准备就绪时,直到 30 秒才会检查服务状态。

After 30 seconds it will try to check the status on the endpoint. 30 seconds后,它将尝试检查端点上的状态。 If successful POD will be in a ready state to handle the traffic or else it will try for another time periodSeconds so after 8 seconds it will try again if we will 200 response POD will be Ready or else will try after 8 seconds.如果成功的 POD 将在准备好的periodSeconds中处理流量,否则它将尝试另一个时间段秒,因此在8秒后它将再次尝试,如果我们将200 response POD 将准备就绪,否则将在8秒后尝试。

timeoutSeconds : single hop or request will wait the amount of time to get response from service or else mark as failed check. timeoutSeconds :单跳或请求将等待从服务获得响应的时间量,否则标记为检查失败。

failureThreshold : Maximum number of failed check after this POD will get started or changed to Not Ready state based on configuration liveness or readiness. failureThreshold :此 POD 将启动或更改为 Not Ready state 后失败检查的最大数量基于配置的活跃性或准备情况。

successThreshold : Successful threshold means if single request get success response from service POD status gets changed to Ready . successThreshold :成功阈值表示单个请求是否从服务 POD 状态获得成功响应时更改为Ready

If continuous 30 failureThreshold occur then only POD will get marked as Not ready if in between single successThreshold occur POD will get mark as Ready same for liveness.如果连续30 个failureThreshold发生,那么只有 POD 将被标记为未准备好,如果在单个successThreshold之间发生,POD 将被标记为Ready ,与 liveness 相同。

Note : Above example is just for reference can not be useful in an actual production scenario.注意:以上示例仅供参考,不能用于实际生产场景。

Read more at: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/阅读更多: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/

It's checked again after the same periodSeconds delay as usual and then when it passes successThreshold times in a row it will be considered Ready again with all the normal behaviors that entails.在与往常一样的相同periodSeconds延迟后再次检查它,然后当它连续通过successThreshold次时,它将再次被视为 Ready 并具有所有正常行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使 Kubernetes 就绪探测失败,Pod 也会收到流量 - Pod receives traffic even Kubernetes readiness probe fails Kubernetes 就绪探测失败 - Kubernetes readiness probe fails state POD 运行后,是否在 kube.netes 事件中进行就绪探测? - Is readiness probe in kubernetes event after the POD is RUNNING state? k8s pod 就绪探测失败,连接被拒绝,但 pod 可以正常处理请求 - k8s pod readiness probe fails with connection refused, but pod is serving requests just fine 准备就绪探针失败,连接被拒绝 - readiness probe fails with connection refused 如何检测 Kubernetes liveness / readiness 探针何时失败并调用传递有关 pod 的一些信息的端点 - How to detect when a Kubernetes liveness / readiness probe fails and invoke an endpoint passing some information about the pod Liveness/Readiness 探针如何与 Pod 通信? - How does a Liveness/Readiness probe communicate with a pod? 状态集的就绪探测,而不是单个 pod/容器 - Readiness probe for statefulset, not individual pod/container 一个 pod 中多个容器的活跃度和就绪度探测 - liveness and readiness probe for multiple containers in a pod 使用 helm chart 安装 Couchbase 失败并出现 Readiness 探针 - Installing Couchbase with helm chart fails with Readiness probe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM