diff --git a/docs/guides-common-k8s-secret-types.md b/docs/guides-common-k8s-secret-types.md index e01aa496c..0d067b231 100644 --- a/docs/guides-common-k8s-secret-types.md +++ b/docs/guides-common-k8s-secret-types.md @@ -19,6 +19,14 @@ Then create a ExternalSecret resource taking advantage of templating to populate {% include 'gcpsm-docker-config-externalsecret.yaml' %} ``` +For Helm users: since Helm interprets the template above, the ExternalSecret resource can be written this way: + +```yaml +{% include 'gcpsm-docker-config-helm-externalsecret.yaml' %} +``` + +For more information, please see [this issue](https://github.com/helm/helm/issues/2798) + This will generate a valid dockerconfigjson secret for you to use! You can get the final value with: @@ -73,5 +81,5 @@ kubectl get secret secret-to-be-created -n | -o jsonpath="{.data.ssh ## More examples -!!! note "We need more examples here" - Feel free to contribute with our docs and add more examples here! \ No newline at end of file +!!! note "We need more examples here" + Feel free to contribute with our docs and add more examples here! diff --git a/docs/snippets/gcpsm-docker-config-helm-externalsecret.yaml b/docs/snippets/gcpsm-docker-config-helm-externalsecret.yaml new file mode 100644 index 000000000..89e607dd8 --- /dev/null +++ b/docs/snippets/gcpsm-docker-config-helm-externalsecret.yaml @@ -0,0 +1,23 @@ +{% raw %} +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: dk-cfg-example +spec: + refreshInterval: 1h + secretStoreRef: + name: example + kind: SecretStore + target: + template: + type: kubernetes.io/dockerconfigjson + engineVersion: v2 + data: + .dockerconfigjson: "{{ `{{ .mysecret }}` }}" + name: secret-to-be-created + creationPolicy: Owner + data: + - secretKey: mysecret + remoteRef: + key: docker-config-example +{% endraw %}