Help Center> Cloud Container Engine> Best Practices> Container> Upgrading Pods Without Interrupting Services

Upgrading Pods Without Interrupting Services

Scenario

You can use rolling upgrade to upgrade pods without interrupting services.

In this mode, pods are upgraded one by one, not all at once.

Prerequisites

The workload to be upgraded has at least two pods. If there is only one pod, you are advised to perform the upgrade after manually scaling the workload into two pods.

Figure 1 Manually scaling the workload

Procedure

  1. Log in to the CCE console. In the navigation pane on the left, choose Workloads > Deployments.
  2. In the workload list, click the name of the workload to be upgraded. The workload details page is displayed.
  3. On the Scaling tab page, check the value of Maximum Number of Unavailable Pods. The value should range from 0 to the number of workload pods. If the maximum number of unavailable pods is the number of workload pods, services may be interrupted.

    Figure 2 Setting maximum number of unavailable pods

  4. Upgrade the workload in rolling upgrade mode.

    1. In the workload list, click the name of the workload to be upgraded. The workload details page is displayed.
    2. On the Upgrade tab page, replace the image or select a new image version.
    3. Click Submit and OK.
      Figure 3 Replacing the image or the image version
    4. On the Pods tab page, you can view that one pod is being created and then the other is being stopped. This ensures that there is always a pod running and the service is not interrupted during the upgrade.
      Figure 4 Rolling upgrade
    5. Click on the right. If both pods are in the running state, the upgrade is successful.