Mount /etc/hosts from host for CoreDNS

This commit is contained in:
Ciprian Hacman 2022-06-30 07:35:40 +03:00
parent 51f2fd613c
commit 29e87b6c15
1 changed files with 12 additions and 1 deletions

View File

@ -77,7 +77,7 @@ data:
ttl 30
}
{{- if GossipDomains }}
hosts /etc/coredns/hosts {{ join GossipDomains " " }} {
hosts /rootfs/etc/hosts {{ join GossipDomains " " }} {
ttl 30
fallthrough
}
@ -167,6 +167,11 @@ spec:
- name: config-volume
mountPath: /etc/coredns
readOnly: true
{{- if GossipDomains }}
- name: etc-hosts
mountPath: /rootfs/etc/hosts
readOnly: true
{{- end }}
ports:
- containerPort: 53
name: dns
@ -204,6 +209,12 @@ spec:
- name: config-volume
configMap:
name: coredns
{{- if GossipDomains }}
- name: etc-hosts
hostPath:
path: /etc/hosts
type: File
{{- end }}
---
apiVersion: v1
kind: Service