Mount configurations

更新时间:
复制 MD 格式

You can mount configuration items or secrets to specified container directories as files to inject configuration information into containers. This topic describes how to configure mounts for applications in the Enterprise Distributed Application Service (EDAS) console.

Background information

The EDAS console supports mounting two types of configurations:
  • Configuration item: Non-confidential configuration information that is configured in advance. The application must be in the same region, cluster, and Kubernetes namespace as the configuration item. Otherwise, the configuration item cannot be used.

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

  • Secret: Confidential information, such as passwords and certificates, that is configured in advance. The application must be in the same region, cluster, and Kubernetes namespace as the secret. Otherwise, the secret cannot be used.

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

Note If you cannot find the configuration mount feature when you create or deploy an application, the EDAS management component in the cluster may be an early version. An effective upgrade method is not available. To use this feature, you must create a new cluster.

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. On the Advanced Settings tab, expand Configuration Management, click Add, and then configure the mount as needed.
    You can mount configuration items or secrets as files to inject configuration information into containers when you create or deploy an application.
    ParameterDescription
    Configuration TypeSelect Configuration Item or Secret.
    Mount TypeSelect Mount to Directory or Mount to File.
    Mount SourceThe name of the configuration item or secret to mount to the file system of the application container.
    Mount Home DirectoryThe home directory in the container to which the configuration is mounted. The path must start with a forward slash (/) and be more than two characters in length.
    File Mount Mode

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

    • Overwrite Source File: Hides the original files in the directory and keeps only the file mounted this time.
    • Keep Original Files: Keeps the original files in the directory and adds the file mounted this time. Note that if a file with the same name exists, the original file is hidden and the file mounted this time is kept.
    Mount Configuration

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

    • Key to Mount: The key specified in the configuration item or secret to mount to the file system of the application container.
    • Mount File Subpath: 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 update an application

If you did not mount a configuration item or secret to a specified container directory when you created an application, you can do so when you deploy the application.

  1. Log on to the EDAS consoleEDAS 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. After you set the environment and deployment package information for the application, expand Configuration Management. Configure the settings as needed and click OK.
    You can mount configuration items or secrets as files to inject configuration information into containers when you create or deploy an application.
    ParameterDescription
    Configuration TypeSelect Configuration Item or Secret.
    Mount TypeSelect Mount to Directory or Mount to File.
    Mount SourceThe name of the configuration item or secret to mount to the file system of the application container.
    Mount Home DirectoryThe home directory in the container to which the configuration is mounted. The path must start with a forward slash (/) and be more than two characters in length.
    File Mount Mode

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

    • Overwrite Source File: Hides the original files in the directory and keeps only the file mounted this time.
    • Keep Original Files: Keeps the original files in the directory and adds the file mounted this time. Note that if a file with the same name exists, the original file is hidden and the file mounted this time is kept.
    Mount Configuration

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

    • Key to Mount: The key specified in the configuration item or secret to mount to the file system of the application container.
    • Mount File Subpath: The subpath relative to the mount home directory.
    Important The application restarts after you click OK. Perform this operation during off-peak hours.

View execution results

  • Method 1:

    On the Change Records page of the application, view the deployment details. If the status is Successful, the deployment was successful and the configuration has taken effect.

  • Method 2:

    On the Application Overview page, click the pod status link in the Running Status field. In the Container Group (Pod) section, check the Status of the pod. If a green circle is displayed, the pod is running. This indicates that the deployment was successful and the configuration has taken effect.

DingTalk group for ACK and Serverless Kubernetes clusters

If you have questions or suggestions about using Container Service for Kubernetes (ACK) and Serverless Kubernetes clusters in EDAS, you can join the DingTalk group by searching for the ID 23197114 in DingTalk.