From 66e5e14bac0c2ca68e474ecc9d5392d800993311 Mon Sep 17 00:00:00 2001 From: Julian Poschmann Date: Sun, 15 Oct 2017 21:22:17 +0200 Subject: [PATCH] Restart kubelet on update in deployment-type host on update (#1759) * Restart kubelet on update in deployment-type host on update * Update install_host.yml * Update install_host.yml * Update install_host.yml --- roles/kubernetes/node/tasks/install_host.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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