Configuring Environment Variables of a Component
Environment variables are set in the container running environment and can be modified after application component deployment, ensuring the flexibility of applications.
This section describes how to configure environment variables during deployment using CCE and VM.
CCE
If Cloud Container Engine is selected for Deployment System on the Configure Basic Settings page during component deployment, add environment variables by referring to the following steps.
- On the Configure Component page, choose Advanced Settings > Component Configuration.
- Add environment variables by referring to Table 1.
Currently, environment variables can be added using any of the following methods:
Table 1 Environment variable types Environment Variable Type
Procedure
Add manually
- Click Add Environment Variable and select Add manually.
- Set Name and Variable/Variable Reference to add an environment variable.
Add from secret
- Create a secret. For details, see Creating a Secret.
- Click Add Environment Variable and select Add from secret.
- Set Name.
- Optional: Select a secret from the Variable/Variable Reference drop-down list.
Add from ConfigMap
- Create a configuration item. For details, see Creating a Configuration Item.
- Click Add Environment Variable and select Add from ConfigMap.
- Enter Name.
- Select a configuration item from the Variable/Variable Reference drop-down list.
Import
Click Import and select a local configuration file.
The imported file must be a key-value pair mapping file in JSON or YAML format. For example:
{"key1":"value1","key2":"value2"}
VM
If VM is selected for Deployment System on the Configure Basic Settings page during component deployment, add environment variables by referring to the following steps.
- On the Configure Component page, click Add Environment Variable.
- Set Key and Value, and click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot