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)06/01 Report--
This article shows you how to use Istio to achieve grayscale publishing, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.
Introduction to grayscale release (also known as canary release)
When the application is launched, one of the major challenges facing operators is how to upgrade without affecting the online business. Students who have done products know that no matter how fully automated and manual tests are done before the release, there will be more or less failures after the release. According to Murphy's law, a version that can go wrong is bound to go wrong.
"ANYTHING THAN CAN GO WRONG WILL GO WRONG"-MURPHY'S LAW
So we can't hope to find all the potential faults during offline testing. When the failure of version upgrade can not be avoided 100%, it is necessary to release the version in a controllable way, control the impact of the failure within an acceptable range, and fall back quickly.
You can use grayscale release (also known as Canary release) to achieve a smooth transition from the old version to the new version, and avoid the impact of problems in the upgrade process on users.
"Canary release" stems from the practice of miners using canaries to test the air in the mine. In the past, when miners dug coal, miners would put canaries in before going down the mine, or they would always take canaries with them when digging coal. Canaries are sensitive to methane and carbon monoxide concentrations and will call the police first. So everyone uses Canary for the first test.
In the image below, a small number of users on the lower left are used as "canaries" to test the newly launched version 1.1. If there is something wrong with the new version, Canaries will call the police, but it will not affect the normal operation of other users' business.
The process of grayscale release (canary release) is as follows:
Prepare a Canary server isolated from the production environment.
Deploy the new version of the service to the Canary server.
Automated and manual testing of services on Canary servers.
After the test passes, connect the Canary server to the production environment and import a small amount of production traffic into the Canary server.
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.
If the online test goes well, gradually import the production traffic into the new version of the server according to a certain strategy.
After the new version of the service is running steadily, delete the old version of the service.
The principle of realizing Grayscale Publishing (Canary Publishing) with Istio
As can be seen from the above process, if you want to achieve a set of grayscale publishing process, you need applications and operation and maintenance processes to support the release process, the workload and difficulty of the challenge is 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 grayscale publishing using Istio is shown below:
Operation steps
The following uses the BookinfoInfo sample program that comes with Istion to test the grayscale publishing process.
Test environment installation
First of all, refer to the hands-on to teach you to build Istio and Bookinfo sample programs from scratch to install Kubernetes and Istio control surfaces.
Because all three versions of the reviews service are not required to be installed in this experiment, if the application is already installed, uninstall it with the following command.
Istio-0.2.10/samples/bookinfo/kube/cleanup.sh deploy V1 version of the service
First, deploy only the V1 version of the Bookinfo application. Since the yaml file in the example contains three versions of the reviews service, we first remove the V2 and V3 versions of Deployment from the yaml file istio-0.2.10/samples/bookinfo/kube/bookinfo.yaml.
Remove this section from Bookinfo.yaml:
ApiVersion: extensions/v1beta1kind: Deploymentmetadata: name: reviews-v2spec: replicas: 1 template: metadata: labels: app: reviews version: v2spec: containers:-name: reviews image: istio/examples-bookinfo-reviews-v2:0.2.3 imagePullPolicy: IfNotPresent ports:-containerPort: 9080---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: reviews-v3spec: replicas: 1 template : metadata: labels: app: reviews version: v3 spec: containers:-name: reviews image: istio/examples-bookinfo-reviews-v3:0.2.3 imagePullPolicy: IfNotPresent ports:-containerPort: 9080-
Deploy the V1 version of the Bookinfo program.
Kubectl apply-f
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.