Configmaps
Scenario 1
Step 1: Configure configmap
as 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
kubectl exec <<POD-NAME>> -c nginx -- env
Scenario 2
Step 1: Configure configmap
as file
kubectl apply -f configmapAsFile.yaml
Step 2: View the configmap
kubectl get configmap
kubectl describe configmap
Step 3: Deployment
kubectl apply -f deployConfigAsFile.yaml
Step 4: View the Deployments
kubectl get deployments
kubectl get pods
Step 5: Verify the Variables
kubectl exec <<POD-NAME>> -c nginx -- cat /usr/config/config.yaml
Clear Everything in the current namespace
kubectl delete all --all -n default
kubectl delete --all configmaps --namespace=default
Last updated
Was this helpful?