A ConfigMap is a resource type that stores configuration information for workloads. You can customize the content of a ConfigMap.
Create a ConfigMap
You can create federated ConfigMaps or ConfigMaps for individual clusters.
Create a federated ConfigMap
Log on to the LHC console. In the navigation pane on the left, click Configuration Management > ConfigMaps.
Click Create. On the Create ConfigMap page, enter the following information:
Namespace: Select a namespace.
Name: Enter a name for the ConfigMap. The name must be unique within the namespace, up to 32 characters in length, and can contain lowercase letters, digits, and hyphens (-). It must start with a letter and end with a letter or a digit.
Configuration Source: Add key-value pairs. The key is the variable name and the value is the configuration data.
Custom Configuration: This option is disabled by default. You can enable it to customize the ConfigMap at the deployment unit level.
After you complete the configuration, click Create.
Create a single-cluster ConfigMap
Log on to the LHC console. In the navigation pane on the left, click Cluster Management > Clusters > Details to open the cluster list page.
Click the name of a cluster to open the Cluster Details page, and then click the Configuration tab.
In the navigation pane on the left, select ConfigMaps.
(Optional) Select a namespace. If you do not select one, the default namespace is used.
Click Create. On the Create ConfigMap page, enter the following information:
Namespace: The namespace to which the ConfigMap belongs. This is based on your selection in the previous step. The default value is default.
Name: Enter a name for the ConfigMap. The name must be unique within the namespace, up to 32 characters in length, and can contain lowercase letters, digits, and hyphens (-). It must start with a letter and end with a letter or a digit.
Configuration Source:
Key-Value Pair: Add key-value pairs. The key is the variable name and the value is the configuration data.
File: Upload a file to create the ConfigMap.
After you complete the configuration, click Submit.
Modify configuration items
Changes to a ConfigMap affect the applications that use it.
On the ConfigMaps list page, click the Name of a ConfigMap to open its details page.
You can make the following changes:
Click Edit to modify existing ConfigMap data, and then click Submit.
Click Add to add a key-value pair, and then click Submit.