Configmaps

Scenario 1

Step 1: Configure configmapas environment variable

kubectl apply -f configmapAsEnv.yaml

Step 2: View the configmap

kubectl get configmap
kubectl describe configmap

Step 3: Perform a Deployment

kubectl apply -f deployConfigAsEnv.yaml

Step 4: View the Deployments

kubectl get deployments

Step 5: Verify the Environment Variable

Don't Forget to replace the pod actual name in the below command

kubectl exec <<POD-NAME>> -c nginx -- env

Scenario 2

Step 1: Configure configmapas file

kubectl apply -f configmapAsFile.yaml

Step 2: View the configmap

Step 3: Deployment

Step 4: View the Deployments

Step 5: Verify the Variables

Don't Forget to replace the pod actual name in the below command

Clear Everything in the current namespace

Last updated

Was this helpful?