From bbe27eacf329fedb406e3ab75dc570894688e76d Mon Sep 17 00:00:00 2001 From: necatican Date: Sat, 9 Oct 2021 21:59:13 +0300 Subject: [PATCH 1/3] Add kubeadm_join_phases_skip variable --- roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml | 1 + roles/kubernetes/kubeadm/tasks/main.yml | 2 ++ roles/kubespray-defaults/defaults/main.yaml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml b/roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml index 1af7f0c6e72..3a4ee8aa625 100644 --- a/roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml +++ b/roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml @@ -57,6 +57,7 @@ {{ bin_dir }}/kubeadm join --config {{ kube_config_dir }}/kubeadm-controlplane.yaml --ignore-preflight-errors=all + --skip-phases={{ kubeadm_join_phases_skip | join(',') }} environment: PATH: "{{ bin_dir }}:{{ ansible_env.PATH }}" register: kubeadm_join_control_plane diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index 6a02f0dab7a..420ea0bb681 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -76,6 +76,7 @@ {{ bin_dir }}/kubeadm join --config {{ kube_config_dir }}/kubeadm-client.conf --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests + --skip-phases={{ kubeadm_join_phases_skip | join(',') }} register: kubeadm_join rescue: @@ -86,6 +87,7 @@ {{ bin_dir }}/kubeadm join --config {{ kube_config_dir }}/kubeadm-client.conf --ignore-preflight-errors=all + --skip-phases={{ kubeadm_join_phases_skip | join(',') }} register: kubeadm_join always: diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index dade9d893f9..27d8001fd53 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -38,6 +38,9 @@ kubeadm_init_phases_skip: >- {{ kubeadm_init_phases_skip_default }} {%- endif -%} +## List of kubeadm join phases that should be skipped when joining to the control plane +kubeadm_join_phases_skip: [] + # A string slice of values which specify the addresses to use for NodePorts. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32). # The default empty string slice ([]) means to use all local addresses. From f53ea1ecd5aca9bc3dbe74279837ff1f805c78c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Necatican=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Sun, 10 Oct 2021 10:08:29 +0300 Subject: [PATCH 2/3] Update kubeadm_join_phases_skip comment Co-authored-by: Cristian Calin <6627509+cristicalin@users.noreply.github.com> --- roles/kubespray-defaults/defaults/main.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 27d8001fd53..84a1b50d5fe 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -38,7 +38,8 @@ kubeadm_init_phases_skip: >- {{ kubeadm_init_phases_skip_default }} {%- endif -%} -## List of kubeadm join phases that should be skipped when joining to the control plane +# List of kubeadm phases that should be skipped when joining a new node +# You may need to set this to ['preflight'] for air-gaped deployments to avoid failing connectivity tests. kubeadm_join_phases_skip: [] # A string slice of values which specify the addresses to use for NodePorts. From 62a446510b52509fc81c4dbff02d5a9c60167429 Mon Sep 17 00:00:00 2001 From: necatican Date: Sun, 10 Oct 2021 10:10:40 +0300 Subject: [PATCH 3/3] Add kubeadm_join_phases_skip_default variable to follow the same logic with kubeadm_init_phases_skip --- roles/kubespray-defaults/defaults/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 84a1b50d5fe..bf73304418c 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -40,7 +40,9 @@ kubeadm_init_phases_skip: >- # List of kubeadm phases that should be skipped when joining a new node # You may need to set this to ['preflight'] for air-gaped deployments to avoid failing connectivity tests. -kubeadm_join_phases_skip: [] +kubeadm_join_phases_skip_default: [] +kubeadm_join_phases_skip: >- + {{ kubeadm_join_phases_skip_default }} # A string slice of values which specify the addresses to use for NodePorts. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).