From 23858da45ba97a9521c2e9f168e582acae5d97c2 Mon Sep 17 00:00:00 2001 From: Jerome228 <37396982+Jerome228@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:33:39 +0100 Subject: [PATCH] Update kubeadm_init.yaml For single Control Plane setup, add --apiserver-advertise-address with the local/private IP address to init command. Otherwise, the join command could use an incorrect IP adress (NAT IP address will be used if it is in the defult route of the control plane server). The workers are not able to join the cluster by using the NAT IP address. --- .../install_and_configure_the_cluster/tasks/kubeadm_init.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst-k8s-ansible/roles/install_and_configure_the_cluster/tasks/kubeadm_init.yaml b/inst-k8s-ansible/roles/install_and_configure_the_cluster/tasks/kubeadm_init.yaml index 83d1b5f..dd371af 100644 --- a/inst-k8s-ansible/roles/install_and_configure_the_cluster/tasks/kubeadm_init.yaml +++ b/inst-k8s-ansible/roles/install_and_configure_the_cluster/tasks/kubeadm_init.yaml @@ -18,7 +18,7 @@ - name: kubeadm init for Single Control Plane Setup become: true - command: kubeadm init --pod-network-cidr={{ k8s_pod_network_cidr }} + command: kubeadm init --pod-network-cidr={{ k8s_pod_network_cidr }} --apiserver-advertise-address={{ ansible_host }} when: - not check_k8s_admin_conf_file.stat.exists - k8s_control_plane_endpoint is not defined or k8s_control_plane_endpoint | length == 0