From b83dc9da636fc2b6f0f1ab446e0645a1fc2e3096 Mon Sep 17 00:00:00 2001 From: k8s-infra-cherrypick-robot <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com> Date: Tue, 21 May 2024 04:28:00 -0700 Subject: [PATCH] Revert "support CoreDNS use host network and config dns port (#10617)" (#11214) This reverts commit bc5b38a77127de126bd35175862414367102e1bf. Co-authored-by: Max Gautier --- roles/kubernetes-apps/ansible/defaults/main.yml | 2 -- .../kubernetes-apps/ansible/templates/coredns-config.yml.j2 | 2 +- .../ansible/templates/coredns-deployment.yml.j2 | 5 ++--- roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 | 2 -- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 0050ce05b..b8f3e2889 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -16,8 +16,6 @@ coredns_ordinal_suffix: "" coredns_deployment_nodeselector: "kubernetes.io/os: linux" coredns_default_zone_cache_block: | cache 30 -coredns_host_network: false -coredns_port: 53 coredns_pod_disruption_budget: false # value for coredns pdb diff --git a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 index acab26628..004ce0643 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 @@ -34,7 +34,7 @@ data: } {% endfor %} {% endif %} - .:{{ coredns_port }} { + .:53 { {% if coredns_additional_configs is defined %} {{ coredns_additional_configs | indent(width=8, first=False) }} {% endif %} diff --git a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 index cbdca5727..e929dba62 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 @@ -24,7 +24,6 @@ spec: annotations: createdby: 'kubespray' spec: - hostNetwork: {{ coredns_host_network | default(false) }} securityContext: seccompProfile: type: RuntimeDefault @@ -76,10 +75,10 @@ spec: - name: config-volume mountPath: /etc/coredns ports: - - containerPort: {{ coredns_port }} + - containerPort: 53 name: dns protocol: UDP - - containerPort: {{ coredns_port }} + - containerPort: 53 name: dns-tcp protocol: TCP - containerPort: 9153 diff --git a/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 index 961e02a6a..0e051c346 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 @@ -20,11 +20,9 @@ spec: - name: dns port: 53 protocol: UDP - targetPort: "dns" - name: dns-tcp port: 53 protocol: TCP - targetPort: "dns-tcp" - name: metrics port: 9153 protocol: TCP