Environment variables and Secrets
Similar to how you can set environment variables in a local environment, you can also pass environment variables and secrets when running the Pods.
Using Environment Variables
To use environment variables, you can set them during the pod creation.
Using Secrets
Secrets are similar to environment variables, but the actual value never leaves the cloud environment. Secrets can be used to store sensitive information like API keys and passwords, which one does not want to accidentally leak into display output.
Alternatively, you might have multiple secrets, like CHOICE_1
, CHOICE_2
with different values, but your pod expects a single secret name. In this case, you can use --secret MY_SECRET=CHOICE_1
. Inside the pod, you can access the secret MY_SECRET
. Note that the value is not CHOICE_1
, but the actual value stored in the secret variable.