← GKE171 / 640
easykubectl

Create a ConfigMap from a file and inject it as environment variables into a deployment

command

kubectl create configmap web-config --from-file=config.properties

also accepted

kubectl create configmap web-config --from-file=config.properties && kubectl set env deployment/web-app --from=configmap/web-config

Command breakdown

Part of the Kubernetes CLI (kubectl) — GKE category.

kubectlcreateconfigmapweb-config--from-file=config.properties
FlagPurpose
--from-fileSet to: config.properties

Test your recall — not just your reading.

Practice with interactive quiz →