Updated on 2024-06-27 GMT+08:00

CCE Rolling Upgrade

KubernetesRelease supports CCE rolling upgrade as well as rolling release of Deployment in CCE/Kubernetes clusters. Supported rolling release types include:

  • Upgrade only the Deployment images in a cluster.
  • Use the native YAML files in your code repository for a CCE cluster. YAML templates can be used as parameters to facilitate reuse.

Prerequisites

The Deployment to upgrade has been created in a CCE cluster.

Procedure

  1. After creating a pipeline and configuring image build, add a KubernetesRelease task to the pipeline and set related parameters. For details about the parameters, see Table 1.

    Table 1 Parameter description

    Parameter

    Description

    Name

    Enter the name of the upgrade. The default name is KubernetesRelease.

    Region

    Select a region for deployment.

    CCE Cluster

    Select the Kubernetes cluster applied in CCE.

    Namespace

    Select the namespace of the Kubernetes cluster on CCE.

    Use IAM to improve permissions

    If you do not have the permission to execute an API, this parameter enables you to obtain the temporary AK/SK of the parent user to execute the CCE API through IAM.

    Deployment Strategy

    The deployment strategy includes Rolling and Blue-Green (we use Rolling as an example).

    • Rolling: rolling release for deployment
    • Blue-Green: ASM-based blue-green release

    Deploy Mode

    Options: Image Upgrade and YAML Deployment

    • Image Upgrade: upgrades the deployment images in a cluster.
    • YAML Deployment: uses the native YAML files in your code repository for a CCE cluster. YAML templates can be used as parameters to facilitate reuse.

    Deploy Mode set to Image Upgrade.

    Workload

    Select a deployment to upgrade.

    Container

    Select a container to upgrade.

    Image URL

    Path of the image to upgrade, for example, swr.cn-north-1.myhuaweicloud.com/demo/springboot-helloworld:v1.1. You can also use ${} to reference pipeline parameters, for example, swr.cn-north-1.myhuaweicloud.com/demo/springboot-helloworld:${version}.

    Deploy Mode set to YAML Deployment.

    Repository

    Code repository where the YAML file is located.

    Branch

    Branch where the YAML file is located.

    YAML path

    YAML file path.

    Variables

    Click Add to add parameters. In a YAML file, {{}} can be used to reference parameters. The KubernetesRelease extension dynamically renders the parameters configured here to the YAML file.

  2. After the extension is configured, run the pipeline and go to the release sheet page to view the upgrade process.

    The page displays information such as the sheet ID, executor, start time, end time, release status, upgrade/rollback information, and release details.

    • To roll back a release, click Rollback to switch the traffic to the old Deployment and bring the new one offline. The Rollback Sheet page is displayed. The content of the rollback sheet is similar to that of the release sheet.
    • Click Release Status to refresh the release status.

    Basic Information

    This area displays the name, type, number of copies, namespace, version, and image of the Deployment to upgrade.

    Release Detail

    This area displays the pod and event information of the Deployment.

    • Pod information
      • Instance Name: pod name.
      • Status: running status of the pod.
      • Pod IP: IP address of the pod.
      • Host IP: IP address of the node where the pod is located.
      • Create Time: time when the instance is created.
    • Key Event

      This area displays the key events of the pod for troubleshooting, including the Kubernetes component name, event type, Kubernetes events, and the time when the key events first and last occurred.