Browse Source

📚 feat: improve docs (#1749)

Signed-off-by: Djerfy <djerfy@gmail.com>
DJΞRFY 3 years ago
parent
commit
55e0c50b30

+ 6 - 0
docs/guides/templating.md

@@ -10,6 +10,12 @@ You can use templates to inject your secrets into a configuration file that you
 {% include 'multiline-template-v2-external-secret.yaml' %}
 ```
 
+Another example with two keys in the same secret:
+
+```yaml
+{% include 'multikey-template-v2-external-secret.yaml' %}
+```
+
 ### TemplateFrom
 
 You do not have to define your templates inline in an ExternalSecret but you can pull `ConfigMaps` or other Secrets that contain a template. Consider the following example:

+ 19 - 0
docs/snippets/multikey-template-v2-external-secret.yaml

@@ -0,0 +1,19 @@
+{% raw %}
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  name: template
+spec:
+  # ...
+  target:
+    template:
+      engineVersion: v2
+      data:
+        name: admin
+        password: "{{ .mysecret }}"                   # If you are using plain manifests or gitops tools
+        # password: '{{ printf "{{ .mysecret }}" }}'  # If you are using templated tools like helm
+  data:
+  - secretKey: mysecret
+    remoteRef:
+      key: /credentials
+{% endraw %}

+ 0 - 1
docs/snippets/multiline-template-v2-external-secret.yaml

@@ -9,7 +9,6 @@ spec:
     name: secret-to-be-created
     # this is how the Kind=Secret will look like
     template:
-      type: kubernetes.io/tls
       engineVersion: v2
       data:
         # multiline string