Container applications

  1. On the top navigation bar, click Business Apps, and then select Applications from the App Management menu.

  1. Click Create Application to enter the Basic Settings page. For information about configuring basic settings, see "Basic settings."

  1. Click Next to enter the Application Configuration page. For information about application configuration steps and parameters, see "Application configuration."

  1. Click Next to enter the Confirm Deployment page, and click Create. To modify the application, click Previous.

Basic settings

Table-1 Configuring basic settings

Parameter

Description

App Name

Enter an application name, a string of 1 to 40 characters. The application name can contain lowercase letters, numbers, and hyphens (-). The application name must start with a lowercase letter and end with a lowercase letter or a number. Make sure the name of the application can indicate its purpose. For example, you can include a project name in the application name.

Version

Specify a version for the application. You can select a history version to roll back to during a rollback operation. As a best practice, use the version number of the released application package. If the application package does not have a version number, you can custom the version number based on the service's functions or release date.

Application Group

Select an existing application group or click Create Application Group to create a new one. For more information about creating application groups, see "Create an application group."

Application Description

Enter a description, a string of 0 to 128 characters. You can use the description to indicate the service's functions, purpose, or other information that facilitate application deployment.

Software Package

Select a software package type. Options include Container Image, Jar Package, War Package, and Helm Package, Legacy Package, and Front-end Resources Package.

  • The image repository stores container images, and the application repository stores Jar, War, Helm, legacy, and front-end resources packages.

  • You can select any of the options except the legacy package for a container application.

  • Container applications deployed on a member cluster managed by an MCP cluster do not support Helm packages.

Deployment Mode

Select a deployment mode:

  • Traditional Deployment: If you select this deployment mode, you can configure the resource as a share cluster or exclusive cluster, and select the nodes to deploy the application.

  • Deploy Through Environment: If you select this deployment mode, you must select an existing environment and add cloud hosts, container clusters, or MCP clusters to the environment. Alternatively, you can add microservices and database resources to the environment. For more information, see "Environment management."

Resource Type

Select the type of the resource where the application will be deployed.

You can deploy a container application on a container cluster or an MCP cluster. If you deploy a container image, Helm package, Jar package, War package, or front-end resources package on a container cluster, the internal time of the container will be consistent with the time of the container cluster. If you deploy a container image, Jar package, War package, or front-end resources package on an MCP cluster, the internal time of the container will be consistent with the time of the MCP cluster.

Type (traditional deployment)

Select an application type:

  • Stateless Apps: A stateless application is a Deployment in Kubernetes and is the most common controller. A stateless application defines a group of identical pods with the same pod name, copy count, and ports. The Deployment controller will ensure that pods in the cluster are the same as defined and can recover from failures automatically. The instances of a stateless application are identical to one another, and each instance is reset upon restart. The information and status of the instance before the restart are not retained. Stateless applications are typically used to provide services that do not require intermediate states to be saved, such as common microservices.

  • Stateful Apps: A stateful application is a StatefuleSet in Kubernetes and can ensure the order and uniqueness of pods. A stateless application also defines a group of identical pods but maintain a unique, persistent identifier for each pod. The identifier does not change across reboots. The instances of a stateful application each have custom information, such as the name and role associated with the ID, and the custom information can survive an instance restart. For example, each pod of Zookeeper has its own name and ID and saves collected cluster information, and the identification and cluster information is retained when a pod restarts.

  • Daemon: A daemon is a Daemonsett in Kubernetes and runs one and only one pod on each node in a cluster, persistent identifier for each pod. This is very applicable to system-level applications, such as log collection applications and resource monitoring applications. A daemon is a required process on each node or specific nodes. When a new node joins the cluster, a daemon starts up on the node automatically.

NOTE:

·          The daemon supports deploying container applications for only the container image, JAR package, WAR package, front-end resources package.

·          The daemon does not support elastic scaling or grayscale upgrade.

·          Only stateless applications are supported if an MCP cluster is deployed.

Resource Configuration (traditional deployment)

Select container cluster resources. You can select Shared Cluster or Exclusive Cluster.

  • If you select Shared Cluster, you can select available domains.

  • If you select Exclusive Cluster, you can select container clusters created from Cloud Services > Cloud Container Engine.

NOTE:

If the application type is daemon and the resource type is shared cluster, you can choose to whether run the application on the control node.

  • If you choose to run the application on the control node, the application runs on all nodes in the container cluster.

  • If you choose not to run the application on the control node, the application runs only on the worker nodes in the container cluster.

  • If the resource type is MCP cluster, select a main cluster instance. After you select a main cluster instance, you can select the primary and backup member clusters deployed on the instance. You can select a backup cluster only if you enable fault failover. For more information about main cluster instances, see "Create a main cluster instance" in "Multi-cloud container management."

Select Environment

Select an existing environment. For information about creating an environment, see "Environment management."

Select Resources

  • Required Resources: You must select at least one cloud host, one MCP cluster, or one container cluster. Only one MCP cluster or container cluster can be selected, and multiple cloud hosts can be selected.

  • Required Resources: Only microservice engines and databases are supported in the current software version.

Fixed IP

Bind the IP address assigned during pod initialization to the application.

 

baloom

·          By default, restarting or upgrading a container instance managed by Kubernetes will cause the IP address of the corresponding pods to be reassigned. If you create a stateful application with a single pod in an exclusive cluster, the IP address assigned during pod initialization is bound to the pod. Users can access the application through the IP address even if the application is restarted or upgraded.

·          A stateful application with a fixed IP address does not support elastic scaling.

·          The fixed IP option appears only if you deploy applications on a container cluster in calico mode.

 

Application configuration

Basic settings

Table-2 Configuring basic settings for deploying a container application

Parameter

Description

Configuration Mode

When the software package type is container image, and the resource is configured as an exclusive cluster, the following configuration modes are supported:

  • Form configuration: Parameter configuration in this table.

If a service requires an initial container, configure an initial container when you edit the YAML file for the service. A service container can use only storage volumes of pods, and an initial container can use only storage volumes of service containers. When you configure storage volumes for a pod, create storage volumes for service containers. When you configure storage volumes for a service container, create storage volumes for the initial container. For more information about YAML deployment for an application that requires an initial container, see "YAML application deployment example (with initial container configuration)."

Image Installation Package

Application Installation Package

Select an installation package or image from the private or public repository, or upload an installation package or image as described in "About application repository service" and "About image repository service"

Environment Variables

Configure user-defined environment variables for containers. 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 configure user-defined environment variables by using the following methods:

  • Manually Specify: Enter a variable name and value.

  • To add more variable name and values, click Add.

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

  • Use Existing ConfigMap: Enter a variable name and select a ConfigMap, version, and key.

  • To add more variable name and values, click Add.

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

  • Use Existing Key: Enter a variable name and select keys.

  • To add more variable name and values, click Add.

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

  • Use Container Info: Enter a variable name and select a value.

  • To add more variable name and values, click Add.

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

Container Flavor

Specify the startup limit and operation limit.

  • Startup Limit: Minimum resources (CPU and memory) required for a container to start up. The startup limit must be smaller than the operation limit. The startup limit specifies the resources to be exclusively assigned to an instance upon instance startup. Make sure the resources are sufficient for instance operation. A high startup limit might waste resources, and a low startup limit might result in frequent resource quests and low operation efficiency. For a Java application, set the startup limit to be 1 GB larger than the JVM maximum heap size.

  • Operation Limit: Maximum resources (CPU and memory) that a container can use. The resources are requested on demand and released when not in need. To ensure availability of the container, set the operation limit according to peak demand. If you do not have load distribution data, set the operation limit to be 1.5 or 2 times as high as the startup limit.

  • When checked, the GPU quota is enabled: Configure the maximum GPU resources that a container can use. The equipment type can be AMD or NVIDIA.

Label

Create a label for identifying a group of applications.

Nginx Version

Specify an 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. This parameter appears only when you deploy a front-end resources package.

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.

 

Table-3 System-defined environment variables

Software package type

Environment variables

WAR package

  • JAR_PARM

  • H3CLOUD_APM_TRIGGER

  • H3CLOUD_SW_AGENT_NAMESPACE

  • H3CLOUD_SW_AGENT_NAME

  • H3CLOUD_SW_AGENT_COLLECTOR_BACKEND_SERVICES

  • SW_AGENT_VERSION

  • TOMCAT_UPGRADE

  • SW_AGENT_CONFIG

  • BASE_JDK_VERSION

  • NAMESPACE

  • SERVICE_NAME

  • JAEGER_AGENT_COMPACT

  • JAEGER_AGENT_BINARY

  • JAEGER_AGENT_ZIPKIN

  • EUREKA_URL

  • CONFIG_URL

  • GRAY_VERSION

  • REGISTRY_TYPE

JAR package

  • JAR_PARM

  • JAR_NAME

  • H3CLOUD_APM_TRIGGER

  • H3CLOUD_SW_AGENT_NAMESPACE

  • H3CLOUD_SW_AGENT_NAME

  • H3CLOUD_SW_AGENT_COLLECTOR_BACKEND_SERVICES

  • SW_AGENT_VERSION

  • SW_AGENT_CONFIG

  • NAMESPACE

  • SERVICE_NAME

  • JAEGER_AGENT_COMPACT

  • JAEGER_AGENT_BINARY

  • JAEGER_AGENT_ZIPKIN

  • EUREKA_URL

  • CONFIG_URL

  • GRAY_VERSION

  • REGISTRY_TYPE

Container image

  • GRAY_VERSION

  • REGISTRY_TYPE

  • EUREKA_URL

  • CONFIG_URL

  • SERVICE_NAME

  • NAMESPACE

  • JAEGER_AGENT_COMPACT

  • JAEGER_AGENT_ZIPKIN

  • JAEGER_AGENT_BINARY

 

Advanced settings

Click Show Advanced Settings to configure advanced settings.

Table-4 Configuring advanced settings for deploying a container application

Parameter

Description

Service Access Configuration

Configure the access mode and port mapping

  • Name: Enter a name for the port mapping, a string of 1 to 32 characters. The port mapping name can contain lowercase letters, numbers, and hyphens (-). The application name cannot start or end with a hyphen (-).

  • Name: Select a protocol. Options include TCP and UDP.

  • Container Port: Enter a container port.

  • Internal Port/Export Port: Enter an internal or external port.

To add more port mappings click the Add icon.

Labels

Create a label for identifying a group of services.

Sticky Sessions

Choose to whether to enable sticky sessions. If you enable this option, a pod will respond to all requests from the same IP address before a session times out.

Select LB

Select an existing LB or create a new LB.

This parameter is available when the resource type is container cluster.

Configure LB Parameters

Configure the southbound and northbound LBs, LB IDs, and the LB tenant IDs.

A service can use an LB through the configured parameters.

This parameter is available when the resource type is container cluster.

Routes for Container Access

Configure access routes. For access routes to take effect, first configure service access settings (see "Add a service").

  • Domain Name: Enter a domain name, for example, btv.com.

  • Load Balancing: Select a load balancing algorithm.

  • Round Robin: Assigns requests to endpoints according to their weights.

  • Least Connections: Assigns requests to the endpoint with the least number of connections.

  • IP Hash: Assigns requests to endpoints based on the hash of source IP addresses.

  • Secure Routes: Select this option to enable HTTPS access mode.

  • Sticky Sessions: Select this option to enable a pod to respond to all requests from the same client.

NOTE:

Access routes do not need to be configured for applications deployed on an exclusive cluster.

App Access Path

Enter a path used to access the application.

After an application is deployed, it can be accessed through IP (domain name):port number/path. This parameter can be configured when the resource type is container image, JAR package, WAR package, or front-end resources package,

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." This parameter is unavailable if the resource type is MCP cluster.

  • Local Storage: Use the storage on the local device. For this storage type, data will be lost after node switchover.

  • Static Provisioning: Use PVs created at the resource menu.

  • Dynamic Provisioning: Use a StorageClass created at the resource menu, which automatically provisions PVs according to required size.

  • Existing PVCs: Use PVCs created at the resource menu.

  • Temporary Storage: Do not use persistent storage.

  • Container Path: Independent path in a container.

  • Host Path: Path on the host.

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

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/Pod Anti-Affinity

Configure a port affinity or anti-affinity rule that specifies which pods with workloads can be or cannot be deployed to the same topology domain. Use affinity to restrict an instance to certain nodes and distribute instances to different topologies.

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." If the container cluster uses the x86 or ARM architecture, the system displays matching image installation packages automatically.

  • 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.

Differentiated Configuration

Configure different image installation packages and environment variables for different member clusters.

  • 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 use the following methods to configure variable names and values.

  • Manually Specify: Enter a variable name and value. To add more variable name and values, click Add. To add multiple variable name and values in bulk, click Quick Add to open a text box, enter variable names and values, and click OK.

  • Use Existing ConfigMap: Enter a variable name and select a ConfigMap, version, and key. To add more variable name and values, click Add. To add multiple variable name and values in bulk, click Quick Add to open a text box, enter variable names and values, and click OK. For an MCP cluster, the ConfigMap must be the one configured for that MCP cluster in "Add application configuration."

  • Use Existing Key: Enter a variable name and select keys. To add more variable name and values, click Add. To add multiple variable name and values in bulk, click Quick Add to open a text box, enter variable names and values, and click OK. For an MCP cluster, the key must be the one configured for that MCP cluster in "Add application configuration."

  • Use Container Info: Enter a variable name and select a value. To add more variable name and values, click Add. To add multiple variable name and values in bulk, click Quick Add to open a text box, enter variable names and values, and click OK.

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.

General 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.

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.

Auto Scaling

Configure auto scaling thresholds. The system will perform auto scaling (increase or reduce the number of pod instances) when the CPU usage or memory usage reaches the threshold. After deployment, you can modify auto scaling thresholds through the application space.

Application Analyzer

Monitors the system operating state, including infrastructure, microservices, 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.

  • For container clusters that use different architectures (x86 or ARM), the system selects a matching base image based on the architecture of the cluster automatically when connection to application diagnostics is enabled for container images. You do not need to manually select a base image.