Skip to content

Commit

Permalink
Add Retry for restart kube-controller-manager
Browse files Browse the repository at this point in the history
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
  • Loading branch information
hang.jiang committed Apr 25, 2023
1 parent f9f5143 commit cdb82a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/kubernetes/preinstall/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@

- name: Preinstall | restart kube-controller-manager crio/containerd
shell: "{{ bin_dir }}/crictl pods --name kube-controller-manager* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'"
register: preinstall_restart_controller_manager
retries: 10
delay: 1
until: preinstall_restart_controller_manager.rc == 0
when:
- container_manager in ['crio', 'containerd']
- inventory_hostname in groups['kube_control_plane']
Expand Down

0 comments on commit cdb82a8

Please sign in to comment.