Kubernetes - Create ConfigMap From YAML File Last Updated : 30 Mar, 2023 Comments Improve Suggest changes Like Article Like Report A ConfigMap is a dictionary consisting of non-confidential data. Its primary role is to keep the configuration separate from the container image. ConfigMap can be created in different ways. This article will cover the declarative approach to creating ConfigMap from the YAML file. Example: apiVersion: This specifies which version of Kubernetes API we use to create the resource object.kind: The kind of resource we're building (ConfigMap here). Other types include Pod, Deployment, Secret, etc.metadata: This specifies the data that helps uniquely identify the object. Metadata contains the name of the ConfigMap and the namespace in which it should be created. If a namespace is not specified, it's created in the default namespace. We can specify additional metadata fields like labels.data: Data specifies the dictionary containing key-value pairs.Step 1. To create a Kubernetes ConfigMap object from the config.yaml file above, run the following command. $ kubectl create configmap [configmap_name] [attribute] [source] Depending on the source, the attribute will be: --from file (if the source is a file/directory)--from-literal (if the source is a key-value pair) Step 2. To get more details about the created ConfigMap, run the following command. $ kubectl describe configmap app-configOutput: Comment More infoAdvertise with us K khushb99 Follow Improve Article Tags : DevOps Explore DevOps BasicsWhat is DevOps ?6 min readDevOps Lifecycle10 min readThe Evolution of DevOps - 3 Major Trends for Future7 min readVersion ControlVersion Control Systems5 min readMerge Strategies in Git4 min readWhich Version Control System Should I Choose?5 min readCI & CDWhat is CI/CD?7 min readUnderstanding Deployment Automation4 min readContainerizationWhat is Docker?8 min readWhat is Dockerfile Syntax?5 min readOrchestrationKubernetes - Introduction to Container Orchestration4 min readFundamental Kubernetes Components and their role in Container Orchestration12 min readHow to Use AWS ECS to Deploy and Manage Containerized Applications?4 min readInfrastructure as Code (IaC)Infrastructure as Code (IaC)6 min readIntroduction to Terraform15 min readWhat is AWS Cloudformation?14 min readMonitoring and LoggingWorking with Prometheus and Grafana Using Helm5 min readWorking with Monitoring and Logging Services5 min readMicrosoft Teams vs Slack4 min readSecurity in DevOpsWhat is DevSecOps: Overview and Tools10 min readDevOps Best Practices for Kubernetes11 min readTop 10 DevOps Projects with Source Code [2025]8 min read Like