You can mount predefined ConfigMaps and secrets to the specified directories of containers in the form of files. This way, configurations can be passed to the containers. This topic describes how to configure mount directories 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: the predefined configurations that do not need to be kept confidential. If you want to apply a ConfigMap to an application, the application must be in the same region, cluster, and Kubernetes namespace as the ConfigMap. Otherwise, the application cannot use the ConfigMap.

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

  • Secrets: the predefined configurations, such as passwords and certificates, that need to be kept confidential. If you want to apply a secret to an application, the application must be in the same region, cluster, and Kubernetes namespace as the secret. Otherwise, the application cannot use the secret.

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

Configure a mount directory when you create an application

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace in the upper part and click Create Application in the upper-left corner.
  3. In the Basic Information step, specify Cluster Type and Application Runtime Environment, and click Next.
    Parameter Description
    Cluster Type Select Kubernetes Clusters.
    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 specify 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 specify 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 specify the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.
    • PHP: Select this option if you want to run this application as a PHP application 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. For more information, see Use images to deploy microservice-based multi-language in Kubernetes clusters.
  4. In the Configurations step, configure the environment information, basic information, deployment method, and resource parameters for the application, and click Next.
  5. In the Advanced Settings step, click Configuration Management and configure a mount directory as needed.
    You can mount ConfigMaps and secrets to the specified directories of containers in the form of files when you create or deploy applications. This way, configurations can be passed to the containers.
    • Mount a ConfigMap.

      Select a ConfigMap from the Mount Source drop-down list and specify a directory in the Mount Directory field.

      ConfigMap - Mounted as a file
    • Mount a secret.

      Select a secret from the Mount Source drop-down list and specify a directory in the Mount Directory field.

      Secret - Mounted as a file
  6. Click Create Application.
  7. In the Creation Completed step, confirm the settings in Basic Information, Configurations, and Advanced Settings, and click Create Application.
    In the upper part of the Application Overview page, click View Details. On the Change List page, you can view the change process. Wait a few minutes until the application is deployed. After the change process is complete, view the running status of the instances in the Basic Information section of the Application Overview page. If the pod that runs the application is in the running state, the application is deployed.

Configure a mount directory when you update an application

If you do not configure a directory to which a ConfigMap or a secret is to be mounted in the form of a file when you create an application, you can configure the directory when you deploy the application.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace in the upper part, and 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 Application 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, click Configuration Management, complete the configuration as needed, and then click OK.
    You can mount ConfigMaps and secrets to the specified directories of containers in the form of files when you create or deploy applications. This way, configurations can be passed to the containers.
    • Mount a ConfigMap.

      Select a ConfigMap from the Mount Source drop-down list and specify a directory in the Mount Directory field.

      ConfigMap - Mounted as a file
    • Mount a secret.

      Select a secret from the Mount Source drop-down list and specify a directory in the Mount Directory field.

      Secret - Mounted as a file
    Notice The application is restarted after you click OK. We recommend that you configure a mount directory during off-peak hours.

Verify the result

  • Method 1

    In the left-side navigation pane of the application details page, click Change List to view the application change details. If the value in the Change Status column is Succeeded, 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 panel that appears, 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.