- Function Overview
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Clusters
- Workloads
- Network
- Storage
- O&M
- Namespaces
- ConfigMaps and Secrets
- Auto Scaling
- Add-ons
- Helm Chart
- Permissions
- Settings
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
- Autopilot Cluster Management
- Add-on Management for Autopilot Clusters
-
Autopilot Cluster Upgrade
- Upgrading a Cluster
- Obtaining Cluster Upgrade Task Details
- Retrying a Cluster Upgrade Task
- Obtaining a List of Cluster Upgrade Task Details
- Performing a Pre-upgrade Check for a Cluster
- Obtaining Details About a Pre-upgrade Check Task of a Cluster
- Obtaining a List of Pre-upgrade Check Tasks of a Cluster
- Performing a Post-upgrade Check for a Cluster
- Backing Up a Cluster
- Obtaining a List of Cluster Backup Task Details
- Obtaining the Cluster Upgrade Information
- Obtaining a Cluster Upgrade Path
- Obtaining the Configuration of Cluster Upgrade Feature Gates
- Enabling the Cluster Upgrade Process Booting Task
- Obtaining a List of Upgrade Workflows
- Obtaining Details About a Specified Cluster Upgrade Booting Task
- Updating the Status of a Specified Cluster Upgrade Booting Task
- Quota Management for Autopilot Clusters
- Tag Management for Autopilot Clusters
-
Chart Management for Autopilot Clusters
- Uploading a Chart
- Obtaining a Chart List
- Obtaining a Release List
- Creating a Release
- Updating a Chart
- Deleting a Chart
- Updating a Release
- Obtaining a Chart
- Deleting a Release
- Obtaining a Release
- Downloading a Chart
- Obtaining Chart Values
- Obtaining Historical Records of a Release
- Obtaining the Quota of a User Chart
- Kubernetes APIs
- Permissions and Supported Actions
- Appendix
-
FAQs
- Billing
- Workloads
- Network Management
-
Storage
- Can PVs of the EVS Type in a CCE Autopilot Cluster Be Restored After They Are Deleted or Expire?
- What Can I Do If a Storage Volume Fails to Be Created?
- Can CCE Autopilot PVCs Detect Underlying Storage Faults?
- How Can I Delete the Underlying Storage If It Remains After a Dynamically Created PVC is Deleted?
- Permissions
- General Reference
Copied.
Creating a ConfigMap
Scenario
A ConfigMap is a type of resource that stores configuration information required by a workload. Its content is user-defined. After creating ConfigMaps, you can use them as files or environment variables in a containerized workload.
ConfigMaps allow you to decouple configuration files from container images to enhance the portability of workloads.
Benefits of ConfigMaps:
- Manage configurations of different environments and services.
- Deploy workloads in different environments. Multiple versions are supported for configuration files so that you can update and roll back workloads easily.
- Quickly import configurations in the form of files to containers.
Notes and Constraints
- The size of a ConfigMap resource file cannot exceed 1 MB.
- ConfigMaps cannot be used in static pods.
Procedure
- Log in to the CCE console and click the cluster name to access the cluster console.
- Choose ConfigMaps and Secrets in the navigation pane and click Create ConfigMap in the upper right corner.
- Configure parameters.
Table 1 Parameters for creating a ConfigMap Parameter
Description
Name
Name of the ConfigMap you create, which must be unique in a namespace.
Namespace
Namespace to which the ConfigMap belongs. If you do not specify this parameter, the value default is used by default.
Description
Description of the ConfigMap.
Data
Data of a ConfigMap, in the key-value pair format.
Click
to add data. The value can be in string, JSON, or YAML format.
Label
Label of the ConfigMap. Enter a key-value pair and click Confirm.
- Click OK.
The new ConfigMap is displayed in the ConfigMap list.
Creating a ConfigMap Using kubectl
- Use kubectl to access the cluster. For details, see Connecting to a Cluster Using kubectl.
- Create a file named cce-configmap.yaml and edit it.
vi cce-configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: cce-configmap data: SPECIAL_LEVEL: Hello SPECIAL_TYPE: CCE
Table 2 Key parameters Parameter
Description
apiVersion
The value is fixed at v1.
kind
The value is fixed at ConfigMap.
metadata.name
ConfigMap name, which can be customized.
data
ConfigMap data. The value must be key-value pairs.
- Run the following commands to create a ConfigMap.
kubectl create -f cce-configmap.yaml
Run the following commands to view the created ConfigMap:
kubectl get cm
NAME DATA AGE cce-configmap 3 7m
Related Operations
Operation |
Description |
---|---|
Editing a YAML file |
Click Edit YAML in the row where the target ConfigMap resides to edit its YAML file. |
Updating a ConfigMap |
|
Deleting a ConfigMap |
Select the configuration you want to delete and click Delete. Follow the prompts to delete the ConfigMap. |
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