5

Kubectl: Get ConfigMap – Kubernetes

 1 year ago
source link: https://www.shellhacks.com/kubectl-get-configmap-kubernetes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Kubectl: Get ConfigMap – Kubernetes

In programming, we use .env or separate config files to store settings, configurations or variables separately from the application code.

This permits to run the application in different environments.

A ConfigMap in a Kubernetes is used to achieve the same functionality – it allows to make applications portable by decoupling environment-specific configurations from the containers.

The ConfigMap is a dictionary of configuration settings that consists of key-value pairs.

This note shows how to get the ConfigMap using the kubectl command.

Cool Tip: Create a Deployment in K8s using the kubectl command! Read more →

Kubectl – Get ConfigMap

Get ConfigMaps using the kubectl command:

$ kubectl get configmap
$ kubectl get configmap --namespace <namespace_name>

Describe the ConfigMap:

$ kubectl describe configmap <configmap_name>

Get the ConfigMap in YAML:

$ kubectl get configmap <configmap_name> -o yaml

Get the ConfigMap and save it to a file:

$ kubectl get configmap <configmap_name> -o yaml > my-configmap.yaml

Cool Tip: How to set a default Namespace in a Kubernetes! Read more →


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK