Add graceful upgrade process

Based on #718 introduced by rsmitty.

Includes all roles and all options to support deployment of
new hosts in case they were added to inventory.

Main difference here is that master role is evaluated first
so that master components get upgraded first.

Fixes #694
This commit is contained in:
Matthew Mosesohn
2017-02-14 19:08:44 +03:00
parent fbaef7e60f
commit 97ebbb9672
5 changed files with 96 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
---
- name: Uncordon node
command: kubectl uncordon {{ ansible_hostname }}
command: "{{ bin_dir }}/kubectl uncordon {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"

View File

@@ -1,11 +1,11 @@
---
- name: Cordon node
command: kubectl cordon {{ ansible_hostname }}
command: "{{ bin_dir }}/kubectl cordon {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"
- name: Drain node
command: kubectl drain --force --ignore-daemonsets --grace-period 30 --delete-local-data {{ ansible_hostname }}
command: "{{ bin_dir }}/kubectl drain --force --ignore-daemonsets --grace-period 30 --delete-local-data {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"
- name: Sleep for grace period for draining