Files
devops-infra-helm-charts-gcp/helm-templates/coredns-1.13.1/templates/configmap.yaml
T
2026-08-26 03:39:42 +05:30

45 lines
2.3 KiB
YAML

apiVersion: v1
data:
Corefile: |
.:53 {
log {
class all
}
health {
lameduck 5s
}
ready
kubernetes cluster.local {
fallthrough in-addr.arpa ip6.arpa
}
{{- range $k, $v := .Values.rewrites }}
{{- $firstSplit := (split "/" $v)._0 }}
{{- if and (or ($.Values.overwriteRegion) ($.Values.communicationType)) (or (and (eq (split "-" $v)._1 "external") (eq (split "-" $v)._2 $.Values.labels.bu)) (and (ne (split "-" $v)._1 "external") (eq (split "-" $v)._3 $.Values.labels.bu))) }}
{{- if eq (split "-" $v)._1 "external" }}
rewrite name {{ $k }}.svc.cluster.local {{ (split "-" $firstSplit)._0 }}-{{ (split "-" $firstSplit)._1 }}-{{ (split "-" $firstSplit)._2 }}{{ if $.Values.overwriteRegion }}-{{ $.Values.overwriteRegion }}{{- end }}-{{ (split "-" $firstSplit)._3 }}-envoy{{ if gt ((split "/" $v) | len) 1 }}-headless{{ end }}.{{ (split "/" $v)._0 }}.svc.cluster.local
{{- else }}
rewrite name {{ $k }}.svc.cluster.local {{ (split "-" $firstSplit)._0 }}-{{ (split "-" $firstSplit)._1 }}-{{ (split "-" $firstSplit)._2 }}-{{ (split "-" $firstSplit)._3 }}{{ if $.Values.overwriteRegion }}-{{ $.Values.overwriteRegion }}{{- end }}{{ if $.Values.communicationType }}-{{ $.Values.communicationType }}{{- end }}-{{ (split "-" $firstSplit)._4 }}-envoy{{ if gt ((split "/" $v) | len) 1 }}-headless{{ end }}.{{ (split "/" $v)._0 }}{{ if $.Values.communicationType }}-{{ $.Values.communicationType }}{{- end }}.svc.cluster.local
{{- end }}
{{- else }}
rewrite name {{ $k }}.svc.cluster.local {{ if eq (split "-" $v)._1 "external" }}{{ if ne (split "-" $v)._2 $.Values.labels.bu }}externalname-{{ end }}{{ else }}{{ if ne (split "-" $v)._3 $.Values.labels.bu }}externalname-{{ end }}{{ end }}{{ (split "/" $v)._0 }}-envoy{{ if gt ((split "/" $v) | len) 1 }}-headless{{ end }}.{{ (split "/" $v)._0 }}.svc.cluster.local
{{- end }}
{{- end }}
prometheus :9153
forward . /etc/resolv.conf {
max_concurrent 1000
prefer_udp
}
cache 300 {
success 9984
denial 9984 15 15
prefetch 2 1m 70%
}
loop
reload
loadbalance
}
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system