Location>code7788 >text

mse~routing implements grayscale functionality for a particular page

Popularity:806 ℃/2024-11-06 01:30:06

a factor (leading an effect)

I have a website A [blue service], to revamp website A [green service], in which the user center has been changed, I hope that when the user visits, if the http request header contains isGroup and isGroup=1, go to the new green service, and vice versa still go to the blue service.

prerequisites

  • Blue and green services where the domain name is the same, such as
  • Bluegreen service, the URL of each page is the same
  • When the user tests access the URL, they do not know which environment they are going to, the blue and green environments are forwarded in the gateway route

Blue-Green Deployment

Blue-Green Deployment (BGD) is a software release strategy designed to reduce system downtime and risk while ensuring continuity of the user experience. Here are some key points about Blue-Green Deployment:

Basic concepts of blue-green deployment

Environmental Delineation:

  • In a blue-green deployment, there are usually two identical production environments: a "blue" environment and a "green" environment.
  • The "blue" environment is currently handling all production traffic, while the "green" environment is used for deployment and testing of new releases.

Toggle flow:

  • Once the new application version has been fully tested in the "green" environment, traffic can be switched from the "blue" environment to the "green" environment by changing the configuration of the load balancer.
  • This switching can be done quickly, thus minimizing user-perceived interruptions.

Rollback mechanism:

  • If a problem is found in the "green" environment, the traffic can be quickly cut back to the "blue" environment for seamless rollback and system stability.

Practice on MSE

In the blue and green services, turn on grayscale publishing in routing and configure a grayscale policy, which can be configured in one of the green services.
II If a blue-green deployment is desired for a page such as/user/centerTo implement it in the user center, you need the following actions

  • Add a new path with the same domain name as before, such as
  • Configure the path identifier: /user/center, both blue and green services should be configured

  • Configure a grayscale policy, blue service, without configuration

  • Green services, you need to turn on gray releases and add a policy, such as a header containing the value isGroup=1, to go green for new services.In the route of the green service, only configure the specific pages to be grayed out, if you require the whole site to be grayed out, the path is /.

test (machinery etc)

  • When you visitWhen accessing the blue color directly, the old version of the service
  • When you visit/user/centerWhen it is still a direct access to the blue, old version of the service
  • When you visit/user/centerand when isGroup=1 is included in the http request header, the green, new version of the service's /user/center page will be accessed