You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2022. It is now read-only.
This issue is a companion to a corresponding PR that is going to be provided.
Problem that is addressed
Application may need more complex Secret keys, like yaml files, for example, that could be constructed from several secrets in secret backend.
Also, some backend ( like Vault) may contain complex data - as nested JSON, while resulting K8S Secret should contain only several fields from complex data.
Currently it's only possible to retrieve either a single field from JSON-like secret, or the whole secret is inserted as json string.
Introducing template engine allows users of this operator to preprocess complex remote secret structures and generate arbitrary flexible values for K8S Secret keys.
Design
Currenlty, the operator does following
Retrieves sensible data from secret backend ( like Vault ) using ExtSec.data as a source.
Generates yaml manifest to be upserted into existing K8S Secret object.
Merges resulting yaml with yaml from ExtSec.template
Eventually upserts K8S Secret.
The change happens before 3. yaml from ExtSec.template is preprocessed with template engine before merging.
Confidential data retrieved from secret backend is accessible via data map in template context.
allows to minimize dependencies since lodash is already used in project
extremely flexible, since allows using pure JavaScript for producing output
Additionally, yaml object will be provided to template context to parse \ dump from \ to Yaml. The object is a instance of js-yaml that is already utilized by the operator.
Example
Let's have 2 secrets in Vault with complex JSON structure.
Context
Started as this idea and continued in Slack
This issue is a companion to a corresponding PR that is going to be provided.
Problem that is addressed
Secret
keys, likeyaml
files, for example, that could be constructed from several secrets in secret backend.Secret
should contain only several fields from complex data.Introducing template engine allows users of this operator to preprocess complex remote secret structures and generate arbitrary flexible values for K8S
Secret
keys.Design
Currenlty, the operator does following
ExtSec.data
as a source.yaml
manifest to be upserted into existing K8SSecret
object.yaml
with yaml fromExtSec.template
Secret
.The change happens before 3.
yaml
fromExtSec.template
is preprocessed with template engine before merging.Confidential data retrieved from secret backend is accessible via
data
map in template context.lodash.template is used as templating engine:
lodash
is already used in projectJavaScript
for producing outputAdditionally,
yaml
object will be provided to template context to parse \ dump from \ to Yaml. The object is a instance of js-yaml that is already utilized by the operator.Example
Let's have 2 secrets in Vault with complex JSON structure.

Having following
ExternalSecret
this operator will generate following
Secret
That could be inspected to see that result is generated by
lodash
templating engineI.e. templating can be used for
Secret
keysstringData
data
Secret
The text was updated successfully, but these errors were encountered: