Hi,
We have a solution that uses K8s and has secrets shared across multiple containers (not ideal but there are valid reasons behind this), the secret is deployed separately and in the same namespace as the containers.
When setting up each container I am attempting to use the “Add all Environment Variables from a secret”, however this does not add any values. I am able to add them individually using the “Add individual environment variable from a secret” however as I’m trying to create a template this is not an idea workflow.
Is there a bug here or something I’m missing as all the examples I’ve found reference secrets deployed alongside the container rather than independently of it as is our case.
I think this line is key to my issue from that article " To expose the secret as environment variables, we expand the Secret Environment Variables section of the container definition".
My secret is deployed independently so that explains why it’s not creating the env vars.
Just jumping in for Adam while he’s offline, I’d be happy to help with your Kube secrets!
We are currently looking for customers who use Kubernetes to interview so we can make sure we are working on the right features, I hope you don’t mind that I’ve passed your email along so someone from our product team should reach out to see if you’d be interested.
I noticed in the Kube docs about the envFrom feature that it’s only available for clusters 1.16+ (1.6 looks to be a typo):
From my understanding of a secret deployed independently, I’ve created a secret using one Octopus project, and then referenced it using the Add all Environment Variables from a secret in another Octopus project, which while it didn’t show any env variables in the Cloud console (AKS), I was able to reference the secret’s key as the name of the variable, screenshots below.
If this isn’t the behaviour you are seeing I’d be happy to look into it further, could you please send through the deployment yaml to our secure Upload Portal that should have all the info we need: