Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Readiness probe

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to understand Readiness detection. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Readiness probe

In addition to Liveness probes, the Kubernetes Health Check mechanism also includes Readiness probes.

Users can use Liveness probe to tell Kubernetes when to restart the container to achieve self-healing, while Readiness probe tells Kubernetes when the container can be added to the Service load balancer pool to provide services.

The configuration syntax of Readiness probe is exactly the same as that of Liveness probe. Here is an example:

This configuration file simply replaces liveness in the previous example with readiness, and let's see what the difference is.

The READY state of Pod readiness has undergone the following changes:

When it was first created, the READY status was unavailable.

15 seconds later (initialDelaySeconds + periodSeconds), the Readiness probe is performed for the first time and returns successfully, setting READY to available.

After 30 seconds, / tmp/healthy is deleted, and after three consecutive Readiness probes fail, READY is set to unavailable.

You can also see the log of failed Readiness probes through kubectl describe pod readiness.

Here's a comparison between Liveness probe and Readiness probe:

Liveness probe and Readiness probe are two Health Check mechanisms. If they are not specifically configured, Kubernetes will adopt the same default behavior for both probes, that is, to determine whether the probe is successful by judging whether the return value of the container startup process is zero.

The configuration methods of the two probes are exactly the same, and the supported configuration parameters are the same. The difference lies in the behavior after probe failure: Liveness probe restarts the container, while Readiness probe sets the container to be unavailable and does not receive requests forwarded by Service.

Liveness probe and Readiness probe are performed independently, and there is no dependency between them, so they can be used alone or at the same time. Use Liveness probe to determine whether the container needs to be restarted to achieve self-healing; use Readiness probe to determine whether the container is ready to provide services.

On how to understand Readiness detection to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report