Hands-on task
k8s: env from ConfigMap and Secret
The Kubernetes cluster in this sandbox (kubectl is already configured) already has a ConfigMap app-config and a Secret app-secret. /root/pod.yaml holds a Pod app (nginx:1.27-alpine) with no environment variables. Open the file in the Editor tab and pull in the whole configuration from the ConfigMap app-config and the Secret app-secret via envFrom. Then create the pod in the cluster from this file and make sure the variables from both objects are visible inside the container.
- kubernetes
- configmap
- secret
- envfrom
- environment variables
- kubectl apply
- kubectl exec