All Products
Search
Document Center

Enterprise Distributed Application Service:Mount configurations

Last Updated:Nov 28, 2023

You can mount predefined ConfigMaps and Secrets to specified directories of containers in the form of files. This allows you to pass predefined configurations to the containers. This topic describes how to mount configurations for applications in the Enterprise Distributed Application Service (EDAS) console.

Background information

The EDAS console allows you to mount the following types of configurations:
  • ConfigMaps: ConfigMaps are predefined and non-confidential. Before applying a ConfigMap to an application, ensure that the application resides in the same region, cluster, and Kubernetes namespace as the ConfigMap.

    For more information about how to create a ConfigMap, see Create a configuration item.

  • Secrets: Secrets are predefined and confidential, such as passwords and certificates. Before applying a Secret to an application, ensure that the application resides in the same region, cluster, and Kubernetes namespace as the Secret.

    For more information about how to create a Secret, see Create a Secret.

Note If the feature for mounting configurations is unavailable when you create or deploy an application, the possible cause is that the management component of EDAS in the cluster in which you want to create or deploy the application is in an early version. No valid update methods are available. We recommend that you create a new cluster to mount configurations.

Mount configurations when you create an application

  1. Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. The Applications page appears. In the top navigation bar, select a region. In the upper part of the page, select a namespace. In the upper-left corner, click Create Application.

  2. In the Basic Information step, specify Cluster Type and Application Runtime Environment and click Next. The following table describes the parameters.

    Parameter

    Description

    Cluster Type

    The type of the cluster in which you want to deploy the application. Select Kubernetes Clusters.

    Application Runtime Environment

    The application runtime environment. Select an application runtime environment based on the type of the hosted application.

    • Java

      • Custom: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster.

      • Java: Select this option if you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application. You can set the Java Environment parameter after you select this option.

      • Tomcat: Select this option if you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application. You can set the Java Environment and Container Version parameters after you select this option.

      • EDAS-Container (HSF): Select this option if you want to use a WAR or FatJar package to deploy the application as a High-speed Service Framework (HSF) application. You can set the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.

    • PHP: Select this option if the application is a PHP application that runs on Apache HTTP Server.

    • Node.js, C++, Go, and Other Languages: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster. The configuration process for multi-language applications is not described in this topic.

  3. In the Configurations step, configure the environment information, basic information, and deployment method for the application, set the related resource parameters, and then click Next.

  4. In the Advanced Settings step, click Configuration Management, click Add, and then mount the configurations as needed.
    You can mount ConfigMaps and Secrets to specified directories of containers in the form of files when you create or deploy applications. This allows you to pass predefined configurations to the containers.
    ParameterDescription
    Configuration TypeThe type of the configuration. Valid values: Configuration Items and Secret.
    Mount Point TypeThe type of the mount directory. Valid values: Directory and File.
    Mount SourceThe name of the ConfigMap or Secret that you want to mount.
    Mount Home DirectoryThe home directory to which the ConfigMap or Secret is mounted in the container. The value must start with a forward slash (/) and must be more than two characters in length.
    Mounting Mode

    This parameter is displayed only when you set the Mount Point Type parameter to File. Valid values:

    • Overwrite Original File: Only the latest mounted file is displayed in the directory.
    • Retain Original File: Both the original file and the latest mounted file are displayed in the directory. If the latest mounted file has the same name as the original file, the original file is hidden and the latest mounted file is displayed.
    Mount Configuration

    This parameter is displayed only when you set the Mount Point Type parameter to File.

    • Mount Key: the key specified by the ConfigMap or Secret that you want to mount.
    • Mount File Path: the subpath relative to the mount home directory.
  5. Click Create Application.

  6. On the Creation Completed page, check the information in the Basic Information, Configurations, and Advanced Settings sections. Then, click Create Application.

    In the upper part of the Application Overview page, click View Details. On the Change List page, view the application change process. Wait several minutes until the application is deployed. After the application change process is complete, view the status of the instance in the Basic Information section of the Application Overview page. If the status shows that a pod is running, the application is deployed.

Mount configurations when you deploy an application

If you did not mount a ConfigMap or Secret when you created an application, you can mount the configuration when you deploy the application.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, click Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, find the application that you want to deploy and click the application name.

  3. On the Overview or Basic information page, choose Deploy > Deploy in the upper-right corner.

  4. On the Select Deployment Mode page, select a deployment mode and click Start Deployment in the upper-right corner of the specified deployment mode section.

  5. Set the runtime environment and deployment package for the application, and click Configuration Management. After the configuration is complete, click OK.
    You can mount ConfigMaps and Secrets to specified directories of containers in the form of files when you create or deploy applications. This allows you to pass predefined configurations to the containers.
    ParameterDescription
    Configuration TypeThe type of the configuration. Valid values: Configuration Items and Secret.
    Mount Point TypeThe type of the mount directory. Valid values: Directory and File.
    Mount SourceThe name of the ConfigMap or Secret that you want to mount.
    Mount Home DirectoryThe home directory to which the ConfigMap or Secret is mounted in the container. The value must start with a forward slash (/) and must be more than two characters in length.
    Mounting Mode

    This parameter is displayed only when you set the Mount Point Type parameter to File. Valid values:

    • Overwrite Original File: Only the latest mounted file is displayed in the directory.
    • Retain Original File: Both the original file and the latest mounted file are displayed in the directory. If the latest mounted file has the same name as the original file, the original file is hidden and the latest mounted file is displayed.
    Mount Configuration

    This parameter is displayed only when you set the Mount Point Type parameter to File.

    • Mount Key: the key specified by the ConfigMap or Secret that you want to mount.
    • Mount File Path: the subpath relative to the mount home directory.
    Important The application is restarted after you click OK. We recommend that you perform this operation during off-peak hours.

Verify the result

  • Method 1

    In the left-side navigation pane of the application details page, click Change Records to view the change details of the application. If the value in the Change Status column is Success, the application is deployed and the configuration takes effect.

  • Method 2

    On the Application Overview page, click Running Pods (Click View) next to Running Status. In the Pod section of the App Configurations panel, check the Status column of the pod. If a green dot appears, the application is in the running state. This means that the application is deployed as expected and the configuration takes effect.