mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -02:30
fix(control-plane): fetch discovery kubeconfig when adding control plane nodes with remove_anonymous_access (#13683)
* fix(control-plane): fetch discovery kubeconfig when adding control plane nodes The 'Get kubeconfig for join discovery process' task is run_once, so its 'when' is evaluated only for the first control plane node. On an existing cluster that node has already run kubeadm, so the task is skipped for all hosts and 'Copy discovery kubeconfig' fails on the new control plane nodes with "'dict object' has no attribute 'stdout'" when remove_anonymous_access (file discovery) is enabled. Drop the kubeadm_already_run condition from the run_once fetch. The copy and join tasks keep their per-host conditions. Signed-off-by: s3onghyun <s3onghyun.hong@gmail.com> * control-plane: mark discovery kubeconfig fetch as not changed Co-authored-by: guoard <guoard@users.noreply.github.com> --------- Signed-off-by: s3onghyun <s3onghyun.hong@gmail.com> Co-authored-by: guoard <guoard@users.noreply.github.com>
This commit is contained in:
@@ -45,9 +45,9 @@
|
|||||||
register: kubeconfig_file_discovery
|
register: kubeconfig_file_discovery
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||||
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- kubeadm_use_file_discovery
|
- kubeadm_use_file_discovery
|
||||||
- kubeadm_already_run is not defined or not kubeadm_already_run.stat.exists
|
|
||||||
|
|
||||||
- name: Copy discovery kubeconfig
|
- name: Copy discovery kubeconfig
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
Reference in New Issue
Block a user