fix resatrt k8s components (#9962)

pull/9970/head
Samuel Liu 2023-04-10 10:51:15 +08:00 committed by GitHub
parent a94b893e2c
commit ece174da7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,7 @@
# FIXME(mattymo): Also restart for kubeadm mode # FIXME(mattymo): Also restart for kubeadm mode
- name: Preinstall | kube-apiserver configured - name: Preinstall | kube-apiserver configured
stat: stat:
path: "{{ kube_manifest_dir }}/kube-apiserver.manifest" path: "{{ kube_manifest_dir }}/kube-apiserver.yaml"
get_attributes: no get_attributes: no
get_checksum: no get_checksum: no
get_mime: no get_mime: no
@ -60,7 +60,7 @@
# FIXME(mattymo): Also restart for kubeadm mode # FIXME(mattymo): Also restart for kubeadm mode
- name: Preinstall | kube-controller configured - name: Preinstall | kube-controller configured
stat: stat:
path: "{{ kube_manifest_dir }}/kube-controller-manager.manifest" path: "{{ kube_manifest_dir }}/kube-controller-manager.yaml"
get_attributes: no get_attributes: no
get_checksum: no get_checksum: no
get_mime: no get_mime: no
@ -92,6 +92,7 @@
- inventory_hostname in groups['kube_control_plane'] - inventory_hostname in groups['kube_control_plane']
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- kube_apiserver_set.stat.exists
- name: Preinstall | restart kube-apiserver crio/containerd - name: Preinstall | restart kube-apiserver crio/containerd
shell: "{{ bin_dir }}/crictl pods --name kube-apiserver* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'" shell: "{{ bin_dir }}/crictl pods --name kube-apiserver* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'"
@ -104,6 +105,7 @@
- inventory_hostname in groups['kube_control_plane'] - inventory_hostname in groups['kube_control_plane']
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- kube_apiserver_set.stat.exists
# When running this as the last phase ensure we wait for kube-apiserver to come up # When running this as the last phase ensure we wait for kube-apiserver to come up
- name: Preinstall | wait for the apiserver to be running - name: Preinstall | wait for the apiserver to be running