Creating a Configuration Item
Configuration items are user-defined resources that store application configurations. They can be used as files or environment variables in applications.
Configuration items allow you to decouple configuration files from images to enhance the portability of applications.
Benefits of configuration items:
- Manage configurations of different environments and services.
- Deploy applications in different environments. You can maintain configuration files in multiple versions, which makes it easy to update and roll back applications.
- Quickly import configurations in the form of files to containers.
Prerequisites
- You have created a CCE cluster that requires a configuration item.
For details about how to create a CCE cluster, see Creating a CCE Cluster.
- You have created a namespace for the configuration item. For details, see Creating a Namespace.
Creating a Configuration Item
- Log in to ServiceStage and choose Application Management > Application Configuration > ConfigMap
- Click Create.
- Create a configuration item by Visualization or YAML.
- Method 1: Visualization. On the displayed page, set the parameters listed in the following table. Parameters marked with an asterisk (*) are mandatory.
Table 1 Parameters for creating a configuration item Parameter
Description
*Configuration Name
Name of a configuration item, which must be unique in the same namespace.
*Cluster
Cluster where the configuration item will be used.
*Namespace
Namespace to which the configuration item belongs. If you do not specify this parameter, the value default is used by default.
Description
Description of the configuration item.
Configuration Data
Used in applications or used to store configuration data. Key is a file name, and Value is the content of the file.
- Click Add Label.
- Set keys and values.
Configuration Labels
Labels are attached to objects, such as applications, nodes, and services, in the form of key-value pairs.
Labels define the identifiable attributes of these objects and are used to manage and select the objects.
- Click Add Label.
- Set keys and values.
- Method 2: YAML.
To create a configuration item by uploading a file, ensure that a resource description file has been created. ServiceStage supports resource description files in YAML format. For details, see Configuration Item Requirements.
- Select a cluster from the Cluster drop-down list.
- (Optional) Click Upload File, select the created configuration item resource file, and then click Open.
- Write or modify the configuration item resource file in Orchestration content.
- Method 1: Visualization. On the displayed page, set the parameters listed in the following table. Parameters marked with an asterisk (*) are mandatory.
- Click Create.
The new configuration item is displayed in the configuration item list.
Configuration Item Requirements
A configuration item resource file should be in YAML format, and the file size cannot exceed 2 MB.
apiVersion: v1 kind: ConfigMap metadata: name: test-configmap data: data-1: value-1 data-2: value-2
Managing Configuration Items
Operation |
Description |
---|---|
Modifying a configuration item |
|
Deleting a configuration item |
Click Delete in the Operation column of the configuration item to be deleted, and follow the system prompts to delete this configuration item. |
Deleting configuration items in batches |
|
Viewing a configuration item |
Click Show YAML in the Operation column of the target configuration item to view the content of the YAML file of the configuration item. |
The configuration item list contains system configuration items, which can only be viewed and cannot be modified or deleted.
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