From 57cf0cc97d1e5c78f8407df9ae2ac6cd0a3d842b Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Fri, 26 May 2017 17:47:25 -0400 Subject: [PATCH 1/2] inventory hostname for cordoning/uncordoning --- roles/upgrade/post-upgrade/tasks/main.yml | 2 +- roles/upgrade/pre-upgrade/tasks/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/upgrade/post-upgrade/tasks/main.yml b/roles/upgrade/post-upgrade/tasks/main.yml index bff9983ff..c32f42491 100644 --- a/roles/upgrade/post-upgrade/tasks/main.yml +++ b/roles/upgrade/post-upgrade/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Uncordon node - command: "{{ bin_dir }}/kubectl uncordon {{ ansible_hostname }}" + command: "{{ bin_dir }}/kubectl uncordon {{ inventory_hostname }}" delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning|default(false) diff --git a/roles/upgrade/pre-upgrade/tasks/main.yml b/roles/upgrade/pre-upgrade/tasks/main.yml index f2251375b..a2b34927f 100644 --- a/roles/upgrade/pre-upgrade/tasks/main.yml +++ b/roles/upgrade/pre-upgrade/tasks/main.yml @@ -14,7 +14,7 @@ {% endif %} - name: Cordon node - command: "{{ bin_dir }}/kubectl cordon {{ ansible_hostname }}" + command: "{{ bin_dir }}/kubectl cordon {{ inventory_hostname }}" delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning @@ -25,6 +25,6 @@ --ignore-daemonsets --grace-period {{ drain_grace_period }} --timeout {{ drain_timeout }} - --delete-local-data {{ ansible_hostname }} + --delete-local-data {{ inventory_hostname }} delegate_to: "{{ groups['kube-master'][0] }}" when: needs_cordoning From c787530be2b084b6ae76870b7eed74e9c2022e88 Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Fri, 26 May 2017 17:48:56 -0400 Subject: [PATCH 2/2] don't uncordon masters --- upgrade-cluster.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/upgrade-cluster.yml b/upgrade-cluster.yml index 8ff4ad4b8..0b4613820 100644 --- a/upgrade-cluster.yml +++ b/upgrade-cluster.yml @@ -67,7 +67,6 @@ - { role: kubernetes/node, tags: node } - { role: kubernetes/master, tags: master } - { role: network_plugin, tags: network } - - { role: upgrade/post-upgrade, tags: post-upgrade } #Finally handle worker upgrades, based on given batch size - hosts: kube-node:!kube-master