Upgrade and roll back applications

Upgrade an application

To view information about application upgrade methods, see "Application upgrade." The following table lists the upgrade methods supported by different deployment modes.

Table-1 Application upgrade method compatibility

Application domain name configured

Resources used in deployment

Supported upgrade methods

Yes

Multiple VM instances

Rolling upgrade, grayscale upgrade, replacement upgrade

Container cluster or MCP cluster

Rolling upgrade, grayscale upgrade

One VM instance

Replacement upgrade, grayscale upgrade

No

Multiple VM instances

Rolling upgrade, replacement upgrade

Container cluster or MCP cluster

Rolling upgrade

One VM instance

Replacement upgrade

 

Stateful applications do not support grayscale upgrade. If an exception occurs because of parameter errors in stateful application upgrade, the exception cannot be removed even if you correct the errors and perform an upgrade or rollback again. You must restart the application to remove the exception.

 

  1. On the top navigation bar, click Business Apps, and then select Applications from the App Management menu. Or, on the top navigation bar, click Business Apps, select Application Groups from the App Management menu, and then click an application group name.

  1. Click an application name.

  1. Click Upgrade.

  1. Configure the upgrade parameters, and then click OK. When upgrading a container application, you can modify advanced settings of the application (see ).

Table-2 Configuring upgrade parameters

Parameter

Description

Upgrade Policy

Select an upgrade policy according to Table-1.

Software Package Version

Select a software package version used for upgrading the application. For an application deployed through Helm or YAML, you can select an image from the image repository.

Current Version

Current version of the application, which cannot be modified.

Target App Version

Select the target application version, a string of 1 to 36 characters. It can contain uppercase letters, lowercase letters, numbers, and special characters, and must start and end with a letter or number.

JVM Parameter

This parameter is supported only for host applications and is optional.

Environment Variables

Configure environment variables for containers.

  • To configure a single environment variable, click enter a variable name and a value.

  • To add multiple variable name and values in bulk, click Quick Add to open a text box, enter variable names and values separated by spaces or carriage returns, and click OK.

Nginx Version

Specify a Nginx version. Only version 1.20 is supported in the current software version. This parameter appears only when you deploy a front-end resources package.

Enable HTTPS

Choose to whether to enable HTTPS. If you enable HTTPS, you must upload a pair of public key certificate and private key certificate.

Public Key Certificate/Private Key Certificate

Upload a public key certificate or private key certificate:

1.     Click upload.

2.     Drag a certificate to the window or click click to upload to upload a certificate.

Nginx Configuration

Upload a configuration file:

1.     Click upload.

2.     Drag a configuration file to the window or click click to upload to upload a configuration file.

If the Nginx configuration is not updated, the application uses the old Nginx configuration after the upgrade.

Weight

Set the weight of the new version, which is the traffic assignment ratio in percentage. For example, if you upgrade an application from v2 to v3 and you set the weight of the new version to 3, the system assigns 3% of the traffic to the new version.

Batch

Applications deployed on cloud host instances and use the rolling upgrade method supports upgrades in batches.

For example, if this parameter is set to 5 for an application that is upgraded on 100 cloud host instances, the application is upgraded five times, 20 cloud host instances each time.

Configlet Value

Specify the start pod ID for the upgrade of a stateful application. Only pods with IDs greater than the specified ID are upgraded.

Rolling upgrade for front-end static packages does not support this field.

 

Table-3 Configuring advanced settings

Parameter

Description

Startup Command

Specify the commands required by container startup and operation,

Storage Volumes

Mount additional storage resources to the container in scenarios that require persistent storage and high disk I/O,

You must first create storage volumes. For information about creating a storage volume, see "Configure a volume."

ConfigMaps

Select an existing ConfigMap for use by the application.

  • Configuration/Version: Specify a ConfigMap by its name and version.

  • Key: Select keys to match configuration data. You can select a single key or all keys to mount all configuration data.

Mount Path: Specify the path to which the configuration data is mounted.

Secrets

Select an existing secret for use by the application.

  • Secret File: Specify a secret file by secret name.

  • Mount Path: Specify the path to which the secret is mounted.

Node Affinity

Use affinity to restrict an instance to certain nodes and distribute instances to different topologies.

Configure a node affinity rule that specifies on which nodes a pod is allowed to be scheduled.

A node affinity rule can be a required one or a preferred one.

Pod Affinity

Configure a port affinity or anti-affinity rule that specifies which pods with workloads can be deployed to the same topology domain.

Pod Anti-Affinity

Configure a port affinity or anti-affinity rule that specifies which pods with workloads cannot be deployed to the same topology domain.

Initial Container

Configure an initial container to define basic configuration for service containers.

  • Initial Container Name: Enter a container name, a string of 1 to 39 characters. The name can contain lower-case letters, digits, and minus signs (-), and it must start with a lower-case letter and end with a lower-case letter or digit.

  • Image Installation Package: Select an installation package from the private or public repository, or upload an installation package as described in "About image repository service."

  • Environment Variables: Configure user-defined environment variables. You can use the environment variables to edit the configuration of containers after application deployment. User-defined environment variables cannot be the same as system-defined environment variables as shown in Table-3. You can only manually enter variable names and values.

  • To add a variable name and value, click Add.

  • To add multiple variable names and values in bulk, click Quick Add to open a text box, enter variable names and values, and click OK.

  • Commands: Enter commands used to control container operation.

  • Command Parameters: Configure parameters of the entered commands.

Health Check

Identifies whether containers and services are operating correctly.

  • Survivability Check: Checks whether a container is active. This check is similar to using the ps command to check whether a process exists. If the check fails, the cluster restarts the container. If the check succeeds, the cluster does not perform any operation on the container.

  • Readiness Probe: Checks whether a container is ready to process user requests. If yes, the cluster allows access to the container. If not, the cluster denies access to the container.

The following check methods are available:

  • Command: Executes a command. If the value 0 is returned, the container is normal. If a value other than 0 is returned, the container is abnormal. This method requires that a related script or program should be integrated in the container.

  • httpGet: Executes an HTTP request. If the returned status code is between 200 and 400, the container is normal. Otherwise, the container is abnormal. This method is applicable to scenarios where the container can provide HTTP services.

  • tcpSocket: Establishes a socket connection with the application in a container by detecting the TCP connectivity. If the socket connection can be established, the container is normal. Otherwise, the container is abnormal.

Parameters include:

  • Initial Probe Delay: Specify the time to wait before performing the first health check.

  • Timeout: Specify the probe timeout time.

  • Probe Interval: Specify the probe interval.

  • Success Threshold: Specify the number of probe successes that a container is determined to be normal.

  • Probe Failure Threshold: Specify the number of probe failures that a container is determined to be abnormal.

  • Path: Enter a request path.

  • Port: Enter a request port.

  • Protocol: Select a protocol for the httpGet method. Options include HTTP and HTTPS.

  • Script: Enter a path script.

Container Privileges

Configure container privileges.

  • Privileged Container: Choose whether to run the container in privileged mode. In this mode, the processes in the container run as root.

  • Host Network/PID/IPC: Choose whether to use the host network, PID, IPC namespace.

  • Read Only Root Filesystem: Choose whether to enable read-only access to the root file system.

  • User UID: Configure a user UID. The container runs with the privilege of the user.

  • Linux Capabilities: Select capabilities supported by Linux from the dropdown list.

Application Analyzer

Monitors the system operating state, including infrastructure, microserivces, basic middleware, service gateways, and links and provides metric analysis tools. This parameter can be configured if the application diagnostics cloud service is deployed.

  • This parameter needs to be configured if the software package type is WAR package, JAR package, front-end resources package, or container image and the application analyzer has been deployed. Select Yes to monitor the applications and application groups.

  • if the software package type is container image, Helm package, or legacy package, configure the SDK or SkyWalking agent in "Prerequisites."

  • If the software package type is container image and application analyzer is enabled, do not repeatedly import SDK or SkyWalking agent to the software package.

  • The Skywalking agent version must be consistent with the JDK version of the image. Skywalking agent 8.x supports JDK8 through JDK17. Skywalking agent 6.x supports JDK6 through JDK12.

  • This function monitors only applications developed by using Java.

 

Roll back an application

You can roll back an application if upgrade fails or the application must be restored to a history version.

To roll back an application:

  1. On the top navigation bar, click Business Apps, and then select Applications from the App Management menu. Or, on the top navigation bar, click Business Apps, select Application Groups from the App Management menu, and then click an application group name.

  1. Click an application name.

  1. Click Roll Back.

  1. Select a history version, and then select Roll Back To.

  1. Click OK.