Setting Application Environment Variables

Environment variables are set in the container running environment and can be modified after application component deployment, ensuring the flexibility of applications.

Adding Environment Variables

  1. During application component deployment, choose Advanced Settings > Component Configurations on the Configure Component page.
  2. Click Add Environment Variable. Currently, three types are supported.

    Table 1 Environment variable types

    Environment Variable Type

    Procedure

    Add manually

    Set the environment variable name and variable value.

    Add from ConfigMap

    You need to create a configuration item.

    1. Set the type to Add from ConfigMap.
    2. Enter Variable Name.
    3. Select a ConfigMap from the Variable/Variable Reference drop-down list.

    Add from secret

    You need to create a secret.

    1. Set the type to Add from secret.
    2. Enter Variable Name.
    3. Select a secret from the Variable/Variable Reference drop-down list.

Importing From a File

  1. When deploying an application component, expand Advanced Settings > Component Configurations on the Configure Component page.
  2. Click Import and select a local file to upload.

    The imported file must be a key-value pair mapping file in JSON or YAML format. Example: {"key1": "value1", "key2": "value2"...}.