I have a number of secret "environment variables" I want to get into a kubernetes cluster. Currently, I have a directory of these secrets where each var has a corresponding file named the same way as the variable it is supposed to be assigned to. Using docker-compose
, this gives me a script like for secret in .secrets/*; do export "$(basename $secret)"="$(cat $secret)" ; done
I'm hoping to avoid explicitly specifying each one of these secrets in the kustomize file(s). Is there a simple way to create one secret per file by only specifying the directory?