I have created a secret.yaml for generating a random password or my application and it works perfect.
{{- if .Values.useSecurity -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "couchdb.fullname" . }}
labels:
type: Opaque
data:
{{ if .Values.adminPassword -}}
couchdb-admin-password: {{ .Values.adminPassword | b64enc | quote }}
{{ else -}}
couchdb-admin-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end -}}
couchdb-admin-user: {{ .Values.adminUser | b64enc | quote }}
{{- end }}
But when the user logged in after a few days the rotation of password should take place using a cronjob. It would be great if anyone helps me to achieve this.