I have something in a secret template like this:
apiVersion: v1
kind: Secret
metadata:
# not relevant
type: Opaque
data:
password: {{ randAlphaNum 32 | b64enc | quote }}
Now, when doing helm upgrade, the secret is recreated, but the pods using this aren't (they also shouldn't, this is OK).
This causes the pods to fail when they are restarted or upgraded as the new password now doesn't match the old one.
Is it possible to skip re-creation of the secret when it exists, like, a {{- if not(exists theSecret) }} and how to do it?