With External Secrets Operator you can transform the data from the external secret provider before it is stored as Secret: https://external-secrets.io/main/guides/templating/
Currently ack-secret-manager only supports jmesPath to grab keys from a JSON-formatted secret, but this is very limited. Below are two ESO examples that I don't think are possible with this solution:
# Simple: Add a prefix to the secret
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: dynatrace-token
spec:
secretStoreRef:
name: my-secret-store
kind: SecretStore
data:
- secretKey: apiToken
remoteRef:
key: dynatrace-access-secret
target:
name: dynatrace-token
template:
data:
dynatraceToken: "Api-Token {{ `{{ .apiToken }}` }}"
# Advanced: Create a config yaml from the secret
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: thanos-objstore-secret
spec:
secretStoreRef:
name: my-secret-store
kind: SecretStore
data:
- secretKey: access_key_id
remoteRef:
key: thanos-access-secret
property: username
- secretKey: access_key_secret
remoteRef:
key: thanos-access-secret
property: password
target:
name: thanos-objstore-secret
creationPolicy: Owner
template:
data:
objstore.yml: |
type: s3
config:
bucket: mybucket
endpoint: s3.eu-central-1.amazonaws.com
access_key_id: "{{ `{{ .access_key_id }}` }}"
access_key_secret: "{{ `{{ .access_key_secret }}` }}"
Templating is very useful since a secret may have to be formatted differently for different apps according to their expectations. Storing the same secret multiple times pre-formatted in KMS is possible but not the cleanest solution.
With External Secrets Operator you can transform the data from the external secret provider before it is stored as Secret: https://external-secrets.io/main/guides/templating/
Currently ack-secret-manager only supports jmesPath to grab keys from a JSON-formatted secret, but this is very limited. Below are two ESO examples that I don't think are possible with this solution:
Templating is very useful since a secret may have to be formatted differently for different apps according to their expectations. Storing the same secret multiple times pre-formatted in KMS is possible but not the cleanest solution.