Skip to content

Instantly share code, notes, and snippets.

@esys
Created December 7, 2020 08:30
Show Gist options
  • Save esys/ef0d6aa8b8dd2b10f758106a186365df to your computer and use it in GitHub Desktop.
Save esys/ef0d6aa8b8dd2b10f758106a186365df to your computer and use it in GitHub Desktop.
Get shell export variables command from a kubernetes pod environment variables
kubectl get deploy some-deployment -ojsonpath='{.spec.template.spec.containers[0].env}' | jq -r '.[] | "export " + join("=")'
# export VAR1=v1
# export VAR2=v2
# export VAR3=v3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment