6 |
7 | {{ fieldName . }}
8 |
9 | {{ if linkForType .Type }}
10 |
11 | {{ typeDisplayName .Type }}
12 |
13 | {{ else }}
14 | {{ typeDisplayName .Type }}
15 | {{ end }}
16 |
17 | |
18 |
19 | {{ if fieldEmbedded . }}
20 |
21 | (Members of {{ fieldName . }} are embedded into this type.)
22 |
23 | {{ end}}
24 |
25 | {{ if isOptionalMember .}}
26 | (Optional)
27 | {{ end }}
28 |
29 | {{ safe (renderComments .CommentLines) }}
30 |
31 | {{ if and (eq (.Type.Name.Name) "ObjectMeta") }}
32 | Refer to the Kubernetes API documentation for the fields of the
33 | metadata field.
34 | {{ end }}
35 |
36 | {{ if or (eq (fieldName .) "spec") }}
37 |
38 |
39 |
40 | {{ template "members" .Type }}
41 |
42 | {{ end }}
43 | |
44 |
45 | {{ end }}
46 | {{ end }}
47 |
48 | {{ end }}
49 |
--------------------------------------------------------------------------------
/docs/guides-all-keys-one-secret.md:
--------------------------------------------------------------------------------
1 | # All Keys, One Secret
2 |
3 | To get multiple key-values from an external secret, not having to worry about how many, or what these keys are, we have to use the dataFrom field of the ExternalSecret resource, instead of the data field. We will give an example here with the gcp provider (should work with other providers in the same way).
4 |
5 | Please follow the authentication and SecretStore steps of the [Google Cloud Secrets Manager guide](provider-google-secrets-manager.md) to setup access to your google cloud account first.
6 |
7 | Then create a secret in Google Cloud Secret Manager that contains a JSON string with multiple key values like this:
8 |
9 | 
10 |
11 | Let's call this secret all-keys-example-secret on Google Cloud.
12 |
13 |
14 | ### Creating dataFrom external secret
15 |
16 | Now, when creating our ExternalSecret resource, instead of using the data field, we use the dataFrom field:
17 |
18 | ```yaml
19 | {% include 'gcpsm-data-from-external-secret.yaml' %}
20 | ```
21 |
22 | To check both values we can run:
23 |
24 | ```
25 | kubectl get secret secret-to-be-created -n