Setting Component Environment Variables
Environment variables are set in the container running environment and can be modified after component deployment, ensuring the flexibility of applications.
Environment variables set for an application component are local environment variables and take effect only for this application component.
If you add an application environment variable to the application where the component is located and the name of the application environment variable is the same as that of the component environment variable in the application, the application environment variable is shielded by the component environment variable and does not take effect for the component. For details about how to add application environment variables, see Managing Application Environment Variables.
This topic describes how to configure component environment variables in different deployment modes during component deployment. For details about the component deployment mode, see Deploying a Component.
Deploying a Component Using CCE
During component deployment, add environment variables on the Advanced Settings page by referring to the following steps.
- 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.
Import from secret
- Create a secret. For details, see Creating a Secret.
- Click Add Environment Variable and select Add from secret.
- Set Name.
- Select a secret from the Variable/Variable Reference drop-down list.
Import from configuration items
- Create a configuration item. For details, see Creating a Configuration Item.
- Click Add Environment Variable and select Add from ConfigMap.
- Set Name.
- Select a configuration item from the Variable/Variable Reference drop-down list.
Import from a file
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"}
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