mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Fix: upgrade cluster discovery kubeconfig not found
When installing or upgrading in the past, there was no validation config. Check if the file exists first to prevent subsequent validation errors. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
@@ -58,6 +58,11 @@
|
|||||||
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||||
when: kubeadm_use_file_discovery
|
when: kubeadm_use_file_discovery
|
||||||
|
|
||||||
|
- name: Check if discovery kubeconfig exists
|
||||||
|
stat:
|
||||||
|
path: "{{ kube_config_dir }}/cluster-info-discovery-kubeconfig.yaml"
|
||||||
|
register: cluster_info_discovery_kubeconfig
|
||||||
|
|
||||||
- name: Copy discovery kubeconfig
|
- name: Copy discovery kubeconfig
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ kube_config_dir }}/cluster-info-discovery-kubeconfig.yaml"
|
dest: "{{ kube_config_dir }}/cluster-info-discovery-kubeconfig.yaml"
|
||||||
@@ -66,7 +71,7 @@
|
|||||||
mode: "0644"
|
mode: "0644"
|
||||||
when:
|
when:
|
||||||
- ('kube_control_plane' not in group_names)
|
- ('kube_control_plane' not in group_names)
|
||||||
- not kubelet_conf.stat.exists
|
- not kubelet_conf.stat.exists or not cluster_info_discovery_kubeconfig.stat.exists
|
||||||
- kubeadm_use_file_discovery
|
- kubeadm_use_file_discovery
|
||||||
|
|
||||||
- name: Create kubeadm client config
|
- name: Create kubeadm client config
|
||||||
|
|||||||
Reference in New Issue
Block a user