Skip to content

Commit

Permalink
Add secretConfiguration.subPath to mount specific files from secret (k…
Browse files Browse the repository at this point in the history
…ubernetes-sigs#3227)

* Add secretConfiguration.subPath to mount specific files from secret

* Apply suggestions from code review

Co-authored-by: Steve Hipwell <[email protected]>

Co-authored-by: Steve Hipwell <[email protected]>
  • Loading branch information
jkroepke and stevehipwell authored Dec 12, 2022
1 parent e0b9399 commit c887237
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ The following table lists the configurable parameters of the _ExternalDNS_ chart
| `secretConfiguration.enabled` | Enable additional secret configuration. | `false` |
| `secretConfiguration.mountPath` | Mount path of secret configuration secret (this can be templated). | `""` |
| `secretConfiguration.data` | Secret configuration secret data. Could be used to store DNS provider credentials. | `{}` |
| `secretConfiguration.subPath` | Sub-path of secret configuration secret (this can be templated). | `""` |
3 changes: 3 additions & 0 deletions charts/external-dns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ spec:
{{- if .Values.secretConfiguration.enabled }}
- name: secrets
mountPath: {{ tpl .Values.secretConfiguration.mountPath $ }}
{{- with .Values.secretConfiguration.subPath }}
subPath: {{ tpl . $ }}
{{- end }}
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/external-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ extraArgs: []
secretConfiguration:
enabled: false
mountPath: ""
subPath: ""
data: {}
# credentials: |
# [default]
# aws_access_key_id = $SECRET_ACCESS_KEY
# aws_secret_access_key = $SECRET_ACCESS_KEY

deploymentStrategy:
type: Recreate

0 comments on commit c887237

Please sign in to comment.