mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-14 11:57:59 +00:00
164e8776ec
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
40 lines
971 B
YAML
40 lines
971 B
YAML
{% raw %}
|
|
# define your template in a config map
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: grafana-config-tpl
|
|
data:
|
|
config.yaml: |
|
|
datasources:
|
|
- name: Graphite
|
|
type: graphite
|
|
access: proxy
|
|
url: http://localhost:8080
|
|
password: "{{ .password | toString }}" # <-- convert []byte to string
|
|
user: "{{ .user | toString }}" # <-- convert []byte to string
|
|
---
|
|
apiVersion: external-secrets.io/v1beta1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: my-template-example
|
|
spec:
|
|
# ...
|
|
target:
|
|
name: secret-to-be-created
|
|
template:
|
|
templateFrom:
|
|
- configMap:
|
|
# name of the configmap to pull in
|
|
name: grafana-config-tpl
|
|
# here you define the keys that should be used as template
|
|
items:
|
|
- key: config.yaml
|
|
data:
|
|
- secretKey: user
|
|
remoteRef:
|
|
key: /grafana/user
|
|
- secretKey: password
|
|
remoteRef:
|
|
key: /grafana/password
|
|
{% endraw %}
|