how to route docker secrets to pod automatically
I have some credentials saved as runpod secrets. After creating a new pod using runpodctl, I manually have to add the secrets to the pod. Is there a way to have the secrets available in the pod, without manually adding them?
6 Replies
Hi there, I just wanted to see if meanwhile maybe thre is somebody willing to give some advice?
Have you tried accessing it directly?
You have to add it as an environment variable then access it from the environment variable
eg: my_super_secret = "password"
then add env variable called:
MY_SUPER_SECRET
: RUNPOD_SECRET_my_super_secret
then access MY_SUPER_SECRET
environment variable to get the secret.Thanks for answering!
@digigoblin you mean adding the environment variables here (see pic) There is no other way to inject the env variables?
Thats the only way in docs i think, have you tried accessing secrets directly?
Yeah not sure whether they are automatically injected as environment variables but I assume not because that could potentially expose secrets to a pod that you don't want them exposed to.
Oh my bad that doesn't work
add env variable called:
RUNPOD_SECRET_SUPER_SECRET : {{ RUNPOD_SECRET_my_super_secret }}
then access RUNPOD_SECRET_SUPER_SECRET environment variable to get the secret.
Secret docs could be better I have to admit