R
RunPod7mo ago
JanE

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
JanE
JanEOP6mo ago
Hi there, I just wanted to see if meanwhile maybe thre is somebody willing to give some advice?
nerdylive
nerdylive6mo ago
Have you tried accessing it directly?
digigoblin
digigoblin6mo ago
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.
JanE
JanEOP6mo ago
Thanks for answering! @digigoblin you mean adding the environment variables here (see pic) There is no other way to inject the env variables?
No description
nerdylive
nerdylive6mo ago
Thats the only way in docs i think, have you tried accessing secrets directly?
digigoblin
digigoblin6mo ago
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
Want results from more Discord servers?
Add your server