Option to create multiple keys in Secrets
Describe the problem/challenge you have When multiple keys are defined in a Password object, the generated secrets are the same across all keys.
Here is an example:
---
apiVersion: secretgen.k14s.io/v1alpha1
kind: Password
metadata:
name: postgresql-password
spec:
secretTemplate:
type: Opaque
stringData:
postgresql-password: $(value)
postgresql-postgres-password: $(value)
repmgr-password: $(value)
What is currently generated:
apiVersion: v1
data:
postgresql-password: ZDJ1cjJiZm1keHFpb2F3cnNtZGYxMHN0YTl0Z2J1anB0cWx3aGdjbA==
postgresql-postgres-password: ZDJ1cjJiZm1keHFpb2F3cnNtZGYxMHN0YTl0Z2J1anB0cWx3aGdjbA==
repmgr-password: ZDJ1cjJiZm1keHFpb2F3cnNtZGYxMHN0YTl0Z2J1anB0cWx3aGdjbA==
kind: Secret
name: postgresql-password
type: Opaque
Describe the solution you'd like It would be fantastic, if each key in the secret would get a unique password.
Anything else you would like to add: N/A
Thank you for your hard work!
@erkerb4 that becomes becomes of an issue for generating multiple passwords and combining them into a single secret (via a template). we've considered adding something like SecretTemplate CR (or something similar) which would be able to aggregate contents of one or more secrets Secrets and produce a new one, but have not fully committed to that approach yet.
Will be eagerly awaiting that implementation. Thank you for your response.