Kubernetes Blue-Green Deployment on Kubesphere
- You need to enable KubeSphere Service Mesh.
- You need to create a workspace, a project and a user (). The user must be invited to the project with the role of
operator
. For more information, see . - You need to enable Application Governance and have an available app so that you can implement the blue-green deployment for it. The sample app used in this tutorial is Bookinfo. For more information, see Deploy Bookinfo and Manage Traffic.
Log in to KubeSphere as
project-regular
and go to Grayscale Release. Under Release Modes, click Create on the right of Blue-Green Deployment.Set a name for it and click Next.
On the Strategy Settings tab, to allow the app version
v2
to take over all the traffic, select Take Over and click Create.The blue-green deployment job created is displayed under the Release Jobs tab. Click it to view details.
The new Deployment is created as well.
You can get the virtual service to identify the weight by running the following command:
Note
- When you run the command above, replace
demo-project
with your own project (namely, namespace) name. - If you want to run the command from the web kubectl on the KubeSphere console, you need to use the user .
- When you run the command above, replace
-
...
hosts:
- reviews
http:
- route:
host: reviews
port:
number: 9080
subset: v2
...
After you implement the blue-green deployment, and the result meets your expectation, you can take the task offline with the version removed by clicking Delete.