Extract kubectl configmap/secret to .env file
Posted on 2021-03-21 in Trucs et astuces • Tagged with devops, k8s, kubernetes
You can extract data from your kubernetes config maps into a .env file with the commands below (requires you to have jq installed):
# Get the data in JSON. kubectl get configmap my-map --output json | # Extract the data section. jq '.data' | # Replace each "key": "value" pair with "key=value" jq -r …
Continue reading