diff --git a/roles/kubernetes/node/tasks/install_host.yml b/roles/kubernetes/node/tasks/install_host.yml index 07c493f48..7fcb4a01d 100644 --- a/roles/kubernetes/node/tasks/install_host.yml +++ b/roles/kubernetes/node/tasks/install_host.yml @@ -1,11 +1,23 @@ --- +- name: install | Compare host kubelet with hyperkube container + command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /usr/bin/cmp /hyperkube /systembindir/kubelet" + register: kubelet_task_compare_result + until: kubelet_task_compare_result.rc in [0,1,2] + retries: 4 + delay: "{{ retry_stagger | random + 3 }}" + changed_when: false + failed_when: "kubelet_task_compare_result.rc not in [0,1,2]" + tags: + - hyperkube + - upgrade + - name: install | Copy kubelet from hyperkube container command: "{{ docker_bin_dir }}/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -f /hyperkube /systembindir/kubelet" + when: kubelet_task_compare_result.rc != 0 register: kubelet_task_result until: kubelet_task_result.rc == 0 retries: 4 delay: "{{ retry_stagger | random + 3 }}" - changed_when: false tags: - hyperkube - upgrade