Skip to content

Commit

Permalink
fix resatrt k8s components (kubernetes-sigs#9962)
Browse files Browse the repository at this point in the history
  • Loading branch information
liupeng0518 authored and pedromcpedro committed May 8, 2024
1 parent 169ca29 commit 1fe74de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions roles/kubernetes/preinstall/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# FIXME(mattymo): Also restart for kubeadm mode
- name: Preinstall | kube-apiserver configured
stat:
path: "{{ kube_manifest_dir }}/kube-apiserver.manifest"
path: "{{ kube_manifest_dir }}/kube-apiserver.yaml"
get_attributes: no
get_checksum: no
get_mime: no
Expand All @@ -60,7 +60,7 @@
# FIXME(mattymo): Also restart for kubeadm mode
- name: Preinstall | kube-controller configured
stat:
path: "{{ kube_manifest_dir }}/kube-controller-manager.manifest"
path: "{{ kube_manifest_dir }}/kube-controller-manager.yaml"
get_attributes: no
get_checksum: no
get_mime: no
Expand Down Expand Up @@ -92,6 +92,7 @@
- inventory_hostname in groups['kube_control_plane']
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- kube_apiserver_set.stat.exists

- 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 %'"
Expand All @@ -104,6 +105,7 @@
- inventory_hostname in groups['kube_control_plane']
- dns_mode != 'none'
- 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
- name: Preinstall | wait for the apiserver to be running
Expand Down

0 comments on commit 1fe74de

Please sign in to comment.