There is actually a lookup
function, but it's fraught with controversy and can be tricky to debug
lookup apiVersion, kind, namespace, name -> resource or resource list
I have only managed to get it to work referencing secrets from the same chart (pointless); I ideally want to get at a value in a secret that I deploy through other means prior.
The application consumes a config file (it is what it is), which I am trying to curate on the fly via a helm template, have the entire file stored in the chart's secret, and volume-mount that within a deployment template.
I may well open a SO-post
What ESO Does For You
ESO nicely separates the concerns of input secrets and output secrets.
Input Secrets:
With its pluggable design you can source Secrets (and ConfigMaps) from Kubernetes (essentially internal secrets) or sensitive -data from AWS (e.g. Secrets Manager, Parameter Store) and other cloud providers (external secrets).
Output Secrets:
Based on input secrets you can either:
- Map them one-to-one into a Secret
- Map them many-to-one, using templating to generate a Secret e.g. containing a config file, where it safely inlines DB credentials
How You Can Use ESO
So with ESO, your Helm Chart's values.yaml
is free to support a UX for those familiar with using Helm.
Pro-Tip: Don't leak your application's configuration structure in to your values.yaml
, thus tightly coupling the two; make use of the 'facade' opportunity the latter presents you.
You can now define whatever notation you want, in your values.yaml
, to indicate/reference a secret that should be used (and from where).
Idea: A possible reference format could be:
secret://external-secret-store/external/secret/path/or/name#key-within-external-secret
This adopts a familiar URI-style, which predates Kubernetes/Helm, therefore should be fairly intuitive to your users out-of-the-box
Your templates/*.yaml
can then interpret those references to generate:
- ExternalSecrets, which in-turn inject and supervise Secrets, and
- Deployments, for example, that reference those injected Secrets as volumes or environment-variables.
Example: A concrete application of this approach using the OP's (abbreviated) values.yaml
:
imageRepository: ""
ocbb:
...
db:
...
schemauser: secret://my-parameter-store/ocbb/db/schema-credentials#username
schemapass: secret://my-parameter-store/ocbb/db/schema-credentials#password
Insight: The values.yaml
has a structure of your choosing and you know ocbb.db.schemapass
, etc, are credentials and may reference secrets, so you template accordingly.
my-parameter-store
: an ESO concept, setup to point to AWS Parameter Store
/ocbb/db/schema-credentials
: an AWS concept, the path to the parameter in AWS Parameter Store
username
,password
: the keys in the JSON object i.e. the parameter in AWS Parameter Store