Skip to content

Commit

Permalink
CoreDNS requires restart after scaling up nodes to be able to resolve…
Browse files Browse the repository at this point in the history
… new hostnames (#2394)

* Do not mount /etc/hosts under the same path

* Restart CoreDNS pods

* Update changelog
  • Loading branch information
to-bar authored Jun 24, 2021
1 parent 14b8649 commit 7cac3fb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-1.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- [#2332](https://github.com/epiphany-platform/epiphany/issues/2332) - [Elasticsearch] Error when having multiple VMs and non-clustered mode
- [#1576](https://github.com/epiphany-platform/epiphany/issues/1576) - [Kafka] Incorrect number of brokers/queues available after scaling up/down
- [#2381](https://github.com/epiphany-platform/epiphany/issues/2381) - Kibana fails to upgrade from epicli v1.0 to v1.1 (version comparison issue)
- [#2345](https://github.com/epiphany-platform/epiphany/issues/2345) - CoreDNS requires restart after scaling up nodes to be able to resolve new hostnames

### Updated

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Based on https://github.com/kubernetes/kubernetes/blob/v1.18.6/cluster/addons/dns/coredns/coredns.yaml.in
# Hosts plugin added

# Note: /etc/hosts in pods is managed by kubelet thus we mount it under different path,
# see https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/#why-does-kubelet-manage-the-hosts-file

apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -16,7 +19,7 @@ data:
lameduck 5s
}
ready
hosts {
hosts /etc/hosts-mounted {
fallthrough
}
kubernetes cluster.local in-addr.arpa ip6.arpa {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
ephemeral-storage: 2Mi
volumeMounts:
- name: hosts-volume
mountPath: /etc/hosts
mountPath: /etc/hosts-mounted
readOnly: true
volumes:
- name: hosts-volume
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@
- name: Patch CoreDNS
include_tasks: patch-coredns.yml

# TODO: Restart conditionally (only when /etc/hosts was updated) or check whether newer CoreDNS would solve issue #2345
- name: Restart CoreDNS pods
command: kubectl rollout restart deployment coredns --namespace kube-system

- name: Apply Kubernetes Dashboard
include_tasks: apply-dashboard.yml

0 comments on commit 7cac3fb

Please sign in to comment.