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 use Health Check in Rolling Update

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

Share

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

In this issue, the editor will bring you about how to use Health Check in Rolling Update. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Another important application scenario for Health Check is Rolling Update. Consider the following situation:

If you have a running multi-copy application, and then update the application (such as using a later version of image), Kubernetes will start the new copy, and the following event occurs:

Normally, it takes 10 seconds for the new copy to complete the preparation, and the business request cannot be responded to until then.

However, due to human configuration errors, the replica is always unable to complete the preparation work (such as unable to connect to the back-end database).

Instead of looking down, now take a minute to think about this: what happens if you don't have Health Check configured?

Because the new copy itself does not exit abnormally, the default Health Check mechanism assumes that the container is ready, and then gradually replaces the existing copy with the new copy. As a result, when all the old copies are replaced, the whole application will not be able to process requests and provide services. If this happens in an important production system, the consequences will be very serious.

If Health Check is configured correctly, the new copy will be added to the Service; only if it passes the Readiness probe. If it does not pass the probe, all the existing copies will not be replaced and the business will still proceed normally.

The following is an example to practice the application of Health Check in Rolling Update.

Simulate a 10-copy application with the following configuration file app.v1.yml:

After 10 seconds, the copy can be detected by Readiness.

Obviously, since / tmp/healthy does not exist in the new copy, it cannot be detected by Readiness. Verify as follows:

If the scrolling update fails, you can roll back to the previous version through kubectl rollout undo.

Summary

In this chapter, we discuss two mechanisms of Kubernetes health check: Liveness probe and Readiness probe, and practice the application of health check in Scale Up and Rolling Update scenarios.

The above is the editor for you to share how to use Health Check in Rolling Update, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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