first cut of an upgrade process

This commit is contained in:
Spencer Smith 2016-12-09 10:44:52 -08:00 committed by Matthew Mosesohn
parent c8f5cf9a99
commit cf3f733828
3 changed files with 50 additions and 0 deletions

View file

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

View file

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

33
upgrade-cluster.yml Normal file
View file

@ -0,0 +1,33 @@
---
- hosts: all
any_errors_fatal: true
gather_facts: true
- hosts: all:!network-storage
any_errors_fatal: true
roles:
- { role: kubernetes/preinstall, tags: preinstall }
- hosts: etcd:!k8s-cluster
any_errors_fatal: true
serial: 1
roles:
- { role: etcd, tags: etcd }
- hosts: kube-node
any_errors_fatal: true
serial: 1
roles:
- { role: etcd, tags: etcd }
- { role: upgrade/pre-upgrade, tags: upgrade/pre-upgrade }
- { role: kubernetes/node, tags: node }
- { role: network_plugin, tags: network }
- { role: upgrade/post-upgrade, tags: upgrade/post-upgrade }
- hosts: kube-master
any_errors_fatal: true
serial: 1
roles:
- { role: etcd, tags: etcd }
- { role: kubernetes/node, tags: node }
- { role: kubernetes/master, tags: master }