In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about the canary release principle of Istio in kubernetes. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.
One: brief introduction
There are a large number of users of Internet products, whether there are unknown risks for the development, operation and maintenance team if full release is adopted, and the product and the operation team are also faced with great challenges to the user experience.
Second: release in advance.
During the release process, users do not perceive the restart of the service, usually through the coexistence of new and old versions, that is to say, in the release process, the new version and the old version are hot standby for each other. Different applications can be online or offline by switching routing weights (either 0 or 100).
Release process:
(1) deploy the application of version 1 (the initial state), and all the traffic of external requests will be sent to this version.
(2) deploy the application of version 2, the code of version 2 is different from version 1 (new features, Bug fixes, etc.).
(3) switch traffic from version 1 to version 2.
(4) if the version 2 test is normal, delete the resources (such as instances) that version 1 is using, and officially use version 2 from now on.
Three: rolling release
Scrolling publishing usually takes one or more servers out of service, performs updates, and puts them back into use. Go round and round until all instances in the cluster are updated to the new version. This deployment is more resource-efficient than blue-green deployment-it doesn't need to run two clusters and twice the number of instances. We can deploy partially, for example, only 20% of the cluster is taken out at a time for upgrade.
This approach also has many disadvantages, such as:
(1) there is no environment that determines OK. With the rolling deployment, we can clearly know that the old version is OK, while with the rolling release, we can't be sure.
(2) the existing environment is modified.
(3) if you need to roll back, it is very difficult. For example, in a release, we need to update 100 instances, 10 instances at a time, and each deployment takes 5 minutes. When you scroll to the 80th instance, a problem is found and needs to be rolled back.
(4) sometimes, we may dynamically scale the system. If the system is automatically expanded / reduced during deployment, we still need to determine which node is using which code. Although there are some automated operation and maintenance tools, it is still frightening.
This is not to say that scrolling publishing is not good, scrolling publishing also has its very appropriate scenarios.
Four: Canary release
Golden Finch release refers to a release way that can make a smooth transition between black and white. The Canary release is a type of incremental release. When the original version is available, the Canary release deploys a new version of the application as a "canary" to test the performance and performance of the new version to ensure the stability of the overall system. Find and adjust the problem as soon as possible.
Canary release consists of the following steps:
(1) be ready to deploy artifacts at all stages, including: build artifacts, test scripts, configuration files, and deployment manifest files.
(2) remove the "Canary" server from the load balance list.
(3) upgrade the Canary application (drain the original traffic and deploy it).
(4) automatic testing of the application.
(5) add the Canary server back to the load balance list (connectivity and health check).
(6) if Canary's online usage test is successful, upgrade the remaining servers. (otherwise roll back)
The goldfinch can ensure the stability of the whole system, and the problem can be found and adjusted at the initial gray level to ensure its influence.
Applicable scenarios for canary deployment:
(1) do not stop the old version, but develop a new version, and different versions of the application will coexist.
(2) in grayscale publishing, routing weights are often set by users. For example, 90% of users maintain the old version and 10% of users try the new version.
(3) it is often used in conjunction with the Aamp B test to select a variety of scenarios for testing. AB test is a grayscale publishing method, which allows some users to continue to use An and some users to start using B. if users have no objection to B, then gradually expand the scope and migrate all users to B.
Fifth: the principle of canary release based on Istio
The release process of the canary is as follows:
(1) prepare a Canary server that is isolated from the production environment.
(2) deploy the new version of the service to the Canary server.
(3) automate and manually test the services on the Canary server.
(4) after passing the test, connect the Canary server to the production environment and import a small amount of production traffic into the Canary server.
(5) if there is a problem with the online test, back up by rerouting production traffic from the Canary server to the old version of the service, fix the problem and republish it.
(6) if the online test is successful, the production traffic will be gradually imported into the new version of the server according to a certain strategy.
(7) after the new version of the service is running steadily, delete the old version of the service.
As can be seen from the above process, if you want to implement a set of golden sparrow development process, you need the application and operation and maintenance process to support the release process, and the workload and difficulty are very great. Although the problems they face are similar, each enterprise or organization generally uses a different privatization implementation scheme for grayscale release, which leads to a lot of costs for R & D and operation and maintenance to solve this problem.
Istio solves this problem in a consistent way through a high degree of abstraction and good design, uses sidecar to forward the application traffic, and issues routing rules through Pilot, which can realize the grayscale release of the application without modifying the application.
Note: the rolling upgrade (rolling UPDATE) function of kubernetes can also be used to upgrade the application without interrupting the business, but the rolling upgrade is to upgrade the application by gradually using the new version of the service to replace the old version of the service. In the rolling upgrade, the flow distribution of the application cannot be controlled, so it is impossible to gradually direct the production traffic to the new version of the service. It is impossible to control the impact of service upgrades on users.
With Istio, specific traffic (such as users with specified characteristics) can be imported into the new version of the service by customizing routing rules, tested in a production environment, and gradually controlled by importing production traffic, thus minimizing the impact of failures in the upgrade on users. And when new and old versions of services exist at the same time, different versions of services can be scaled down and expanded independently according to the application pressure, which is very flexible.
The process of publishing Goldfinch using Istio is shown below:
1. Deploy Reviews-V1, with all traffic directed to V1
two。 Deploy Reviews-V2
3. Import some of the traffic into V2 (for example, 10%) by using Istio routing rules
4. Gradually increase traffic configuration
5. All traffic is switched to V2, and V1 is deleted.
This is what the canary release principle of Istio implementation in kubernetes is shared by the editor. If you happen to have similar doubts, please 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.