This topic describes how to remove the earlier version of a service when the latest version of the service (which has been released through a gray release) has run without exceptions for a specified period of time.
- You have created a Kubernetes cluster. For more information, see Create a Kubernetes cluster.
- You have connected to the Kubernetes cluster by using kubectl, see Connect to a Kubernetes cluster by using kubectl.
- You have deployed an earlier version of the service. For more information, see Step 1: Deploy a service. You have also released a later version of the service through a gray release. For more information, see Step 2: Release the latest version of a service.
Run a command
- Run the following command to edit the YAML file deployed by Step 2: Release the latest version of a service to remove the earlier version of the service:
Note You need to remove the
$ kubectl get ingress gray-release-02
Use the Container Service console
- Log on to the Container Service console.
- In the left-side navigation pane under Kubernetes, choose .
- Select the target cluster and namespace, select the target Ingress, and click Update in the action column.
- In the displayed dialog box, modify the Ingress as follows:
- In the
- Click Update.
- In the
- Return to the Ingress page. Here, you can see that only one Ingress rule points to the new-nginx service.
- Log on to the Master node and run the curl command to view the Ingress access.
$ curl -H "Host: www.example2.com" http://<EXTERNAL_IP>
Now, all requests are routed to the latest version of the service, which means you have completed the gray release deployment cycle. You can also remove the deployment and service of the earlier version.