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--
Today Xiaobian to share with you based on Istio and Kubernetes on the application grayscale release method is what the relevant knowledge, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you have something to gain after reading this article, let's take a look at it.
Grayscale publishing refers to a release way that can make a smooth transition between black and white. In popular terms, the iteration of the product can test the online environment of the new version according to different grayscale strategies, and the grayscale release can ensure the stability of the whole system. In the initial gray level, the new version can be tested, found and adjusted to ensure its influence. Based on Istio, KubeSphere provides three grayscale strategies: blue-green deployment, canary release, and traffic mirroring. Service governance functions such as grayscale, traffic governance, Tracing, traffic monitoring and call chain can be implemented without modifying the service code of the application.
Purpose
This example uses the Bookinfo example provided officially by Istio in the KubeSphere container platform to create a micro-service application and publish the service components in grayscale to demonstrate the ability of KubeSphere service governance.
Bookinfo micro-service application architecture
Bookinfo applications are divided into four separate microservices:
Productpage: the productpage microservice invokes two microservices, details and reviews, to generate pages.
Details: this microservice contains information about books.
Reviews: this microservice contains book-related reviews, and it also invokes the ratings microservice.
Ratings: the ratings microservice contains rating information made up of book reviews.
There are three versions of reviews microservice:
The v1 version does not invoke the ratings service, so the star icon is not displayed in the interface.
The v2 version invokes the ratings service and uses 1 to 5 black star icons to display rating information.
The v3 version invokes the ratings service and uses 1 to 5 red star icons to display rating information.
The following figure shows the end-to-end architecture of this application.
(Bookinfo architecture diagram and sample description are referenced from https://istio.io/docs/examples/bookinfo/)
Estimated time
About 20-30 minutes.
prerequisite
Opened the installation of Service Mesh
Enterprise space, project, and regular user project-regular accounts have been created, and project-regular has been invited to join the project and granted the operator role
You need to select "Project Settings" → "Advanced Settings"→" Settings Gateway under the current project, and click the open button of "Application Governance".
Operation example to create a homemade application
After entering the project demo-project using the project ordinary user project-regular account, select Application load → Application, and click "deploy sample Application".
In the pop-up window, click OK to deploy the bookinfo sample application.
Confirm that all deployment status of the application workload shows that it is running, which means that the bookinfo microservice was created successfully (about 2 minutes).
Access to Bookinfo application
Click bookinfo to enter the application details page, and you can see the automatically generated hostname under the application route.
Since NodePort is enabled for public network access, NodePort opens the http port on the host. To access bookinfo applications, you need to forward the port and add downstream rules in the firewall to ensure that traffic can pass through the port.
Open the / etc/hosts file locally and add a record for hostname, for example:
# {Public Network IP} {hostname} 139.198.111.111 productpage.demo-project.192.168.0.8.nip.io
After completing the above steps, select "Click to visit" under the application route to see the details page of bookinfo.
Click Normal user to access productpage. Notice that only Reviewer1 and Reviewer2 are displayed in the Book Reviews section at this time.
Add grayscale publishing
Go back to KubeSphere, select "Grayscale publish" and click "publish Grayscale Task".
On the jump grayscale release page, select "Canary release" as the grayscale strategy, and click "publish Task".
In the pop-up window, fill in the release task name as bookinfo-carary, and click "next".
Click "Select" in the reviews column, that is, select to publish the application component reviews in grayscale, and click "next".
Refer to the following to fill in the grayscale version information, and click "next" when you are finished.
Grayscale version number: v2
Mirror: istio/examples-bookinfo-reviews-v2:1.10.1 (change v1 to v2).
Canary release allows two publishing strategies, proportional to traffic and by request content, to control users' request rules for new and old versions. This example chooses to be distributed according to the proportion of traffic, with v1 and v2 accounting for 50% each, and click "create".
Verify Canary release
Visit the Bookinfo website again, and after repeatedly refreshing the browser, you can see that the reviews modules of bookinfo switch randomly at 50% probability in v1 and v2 modules.
View the traffic topology diagram
Open a command line window and enter the following command to introduce real access traffic to simulate access to the bookinfo application every half a second. Note that the following command simulates Normal user access, and you need to enter a complete command to access the specific service before there is traffic data in the link diagram.
$watch-n 0.5 "curl http://productpage.demo-project.139.198.111.111.nip.io:31680/productpage?u=normal"
From the link diagram of traffic governance, we can see the service invocation and dependency, health status, performance and so on.
Tip: by clicking on one of the application components, you can also set traffic governance policies for the service component, such as connection pool management, fuses, etc.
View traffic monitoring
Click the reviews service to view the real-time traffic monitoring of the service, including traffic per second (RPS), success rate, duration and other indicators. These indicators can analyze the health status and request success rate of the service.
View Tracing
If a service traffic monitoring exception is found in the link diagram, you can also track the details such as which services have been passed by an end-to-end call and the time spent by each service in the Tracing. You can further view the relevant Header information. Each call chain is composed of multiple Span.
All the phases and internal calls of a request, as well as the time spent on each phase, can be clearly seen on the interface.
When you expand a phase, you can drill down to see which machine (or container) the phase is performed on.
Take over all traffic
When the new version v2 is released in grayscale, the publisher can test the new version online and collect user feedback. If you determine that there is no problem with the new version after testing, and you want to completely switch the traffic to the new version, enter the grayscale release page to take over the traffic.
Click "Grayscale release" to enter the bookinfo grayscale release details page, click to select "take over all traffic", normally all traffic will point to v2.
Tip: at this time, v1 will also remain online. If a problem is found after v2 is online, the publisher is allowed to switch the traffic of the new version v2 back to v1 at any time.
Open the bookinfo page again, and after several refreshes, the reviews module only displays the v2 version.
Offline the old version
When the new version v2 takes over all traffic online, and the test and online user feedback are confirmed to be correct, you can offline the old version and release the resources of resource v1. A specific version of the offline application component will delete all associated workloads and istio-related configuration resources at the same time.
These are all the contents of this article entitled "what is the method of grayscale publishing applications based on Istio and Kubernetes?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.