add retries for restart of kube-apiserver (#9256)

* add retries for restart of kube-apiserver

* change var name
This commit is contained in:
Krystian Młynek 2022-09-08 01:48:49 +02:00 committed by GitHub
parent ad7cefa352
commit 6386ec029c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,6 +95,10 @@
- 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 %'"
register: preinstall_restart_apiserver
retries: 10
until: preinstall_restart_apiserver.rc == 0
delay: 1
when: when:
- container_manager in ['crio', 'containerd'] - container_manager in ['crio', 'containerd']
- inventory_hostname in groups['kube_control_plane'] - inventory_hostname in groups['kube_control_plane']