| Giorgi Lekveishvili | ec6b3cc | 2023-12-01 16:30:04 +0400 | [diff] [blame] | 1 | {{- if .Values.deployment.enabled }} |
| 2 | --- |
| 3 | apiVersion: v1 |
| 4 | kind: ConfigMap |
| 5 | metadata: |
| 6 | name: {{ template "coredns.fullname" . }} |
| 7 | labels: {{- include "coredns.labels" . | nindent 4 }} |
| 8 | {{- if .Values.customLabels }} |
| 9 | {{ toYaml .Values.customLabels | indent 4 }} |
| 10 | {{- end }} |
| 11 | {{- with .Values.customAnnotations }} |
| 12 | annotations: |
| 13 | {{- toYaml . | nindent 4 }} |
| 14 | {{- end }} |
| 15 | data: |
| 16 | Corefile: |- |
| 17 | {{- range $name, $conf := .Values.extraConfig }} |
| 18 | {{ $name }}{{ if $conf.parameters }} {{ $conf.parameters }}{{ end }} |
| 19 | {{- end }} |
| 20 | {{ range .Values.servers }} |
| 21 | {{- range $idx, $zone := .zones }}{{ if $idx }} {{ else }}{{ end }}{{ default "" $zone.scheme }}{{ default "." $zone.zone }}{{ else }}.{{ end -}} |
| 22 | {{- if .port }}:{{ .port }} {{ end -}} |
| 23 | { |
| 24 | {{- range .plugins }} |
| 25 | {{ .name }}{{ if .parameters }} {{ .parameters }}{{ end }}{{ if .configBlock }} { |
| 26 | {{ .configBlock | indent 12 }} |
| 27 | }{{ end }} |
| 28 | {{- end }} |
| 29 | } |
| 30 | {{ end }} |
| 31 | {{- range .Values.zoneFiles }} |
| 32 | {{ .filename }}: {{ toYaml .contents | indent 4 }} |
| 33 | {{- end }} |
| 34 | {{- end }} |