It is possible to pass some ENV variables to the pod via the --env
option of kubectl run
, for example:
kubectl run -ti --rm test --image=busybox --env location=city --env time=morning --namespace default -- sh
I would like to send all the present ENV variables to the pod without specifying all of them the via --env
, especially for those that I might not know the variable name. Is there an way to do so? Thanks
You could try something like this:
kubectl run -ti --rm test --image=busybox $(printenv | xargs -I % echo '--env' "%" | tr '\n' ' ') --namespace default -- sh