diff --git a/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml b/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml index 46ab6296600783085864fa07fba7e1b5f372190f..92605b32d032eae4afd80c670dadef7159149807 100644 --- a/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml +++ b/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml @@ -134,6 +134,7 @@ dns_mode: coredns # Enable nodelocal dns cache enable_nodelocaldns: true nodelocaldns_ip: 169.254.25.10 +nodelocaldns_health_port: 9254 # Can be docker_dns, host_resolvconf or none resolvconf_mode: docker_dns diff --git a/roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2 b/roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2 index f3a5e3142499605af6d16b208df895870693781d..e56cc534af89a647ae0c73f4a3e62f3a1f247a0e 100644 --- a/roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/nodelocaldns-config.yml.j2 @@ -21,7 +21,7 @@ data: force_tcp } prometheus :9253 - health {{ nodelocaldns_ip }}:8080 + health {{ nodelocaldns_ip }}:{{ nodelocaldns_health_port }} } in-addr.arpa:53 { errors diff --git a/roles/kubernetes-apps/ansible/templates/nodelocaldns-daemonset.yml.j2 b/roles/kubernetes-apps/ansible/templates/nodelocaldns-daemonset.yml.j2 index 96e404edcf2519fe3ae4ee5b4ff3cc64aecf0af1..61c8a547625014ecae35a3503d222b7a9a2da613 100644 --- a/roles/kubernetes-apps/ansible/templates/nodelocaldns-daemonset.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/nodelocaldns-daemonset.yml.j2 @@ -58,7 +58,7 @@ spec: httpGet: host: {{ nodelocaldns_ip }} path: /health - port: 8080 + port: {{ nodelocaldns_health_port }} scheme: HTTP timeoutSeconds: 5 successThreshold: 1 @@ -67,7 +67,7 @@ spec: httpGet: host: {{ nodelocaldns_ip }} path: /health - port: 8080 + port: {{ nodelocaldns_health_port }} scheme: HTTP timeoutSeconds: 5 successThreshold: 1 diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 3f135c4de46c5ac37a61abcc8fb7e3fc40d1a911..13cdce8bf800bd502d39e057d6433e3e118873d2 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -68,6 +68,7 @@ dns_mode: coredns # Enable nodelocal dns cache enable_nodelocaldns: true nodelocaldns_ip: 169.254.25.10 +nodelocaldns_health_port: 9254 # Should be set to a cluster IP if using a custom cluster DNS manual_dns_server: ""