I am trying to create externalsecrets
but the template is not working and giving the below error
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: mongodb{{- $suffix }}secret
namespace: {{ $.Values.namespace }}
spec:
refreshInterval: 1m
secretStoreRef:
kind: ClusterSecretStore
name: {{ $.Values.mongodb.secrets.secretStore }}
target:
name: mongodb{{- $suffix }}secret
creationPolicy: Owner
template:
mergePolicy: Merge
data:
url: "mongodb://{{ .username }}:{{ .password }}@mongodb{{ $suffix }}:27017/meteor?authSource=admin"
data:
- secretKey: "username"
remoteRef:
key: {{ $.Values.mongodb.secrets.key }}
version: latest
property: username
- secretKey: "password"
remoteRef:
key: {{ $.Values.mongodb.secrets.key }}
version: latest
property: password
This is the values.yaml
mongodb:
image: mongo:4
mongolist:
- 2
secrets:
gcpSecret: test
username: username
password: password
Error:
Error: template: test/templates/_mongodb.yaml:103:27: executing "mongodb" at <.username>: can't evaluate field username in type []interface {}
Can you let me know what is the issue