2017-03-06 18:22:13 +08:00
|
|
|
---
|
2017-03-30 04:28:05 +08:00
|
|
|
- name: "Post-upgrade | stop kubelet on all masters"
|
2017-03-24 23:29:28 +08:00
|
|
|
service:
|
|
|
|
name: kubelet
|
2017-03-30 04:28:05 +08:00
|
|
|
state: stopped
|
|
|
|
delegate_to: "{{item}}"
|
|
|
|
with_items: "{{groups['kube-master']}}"
|
|
|
|
when: needs_etcd_migration|bool
|
2017-07-28 01:46:21 +08:00
|
|
|
run_once: true
|
2017-03-30 04:28:05 +08:00
|
|
|
|
|
|
|
- name: "Post-upgrade | Pause for kubelet stop"
|
|
|
|
pause:
|
|
|
|
seconds: 10
|
|
|
|
when: needs_etcd_migration|bool
|
|
|
|
|
|
|
|
- name: "Post-upgrade | stop kubelet on all masters"
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
state: started
|
2017-03-24 23:29:28 +08:00
|
|
|
delegate_to: "{{item}}"
|
|
|
|
with_items: "{{groups['kube-master']}}"
|
|
|
|
when: needs_etcd_migration|bool
|
2017-07-28 01:46:21 +08:00
|
|
|
run_once: true
|
2017-03-24 23:29:28 +08:00
|
|
|
|
2017-03-06 18:22:13 +08:00
|
|
|
- name: "Post-upgrade | etcd3 upgrade | purge etcd2 k8s data"
|
|
|
|
command: "{{ bin_dir }}/etcdctl --endpoints={{ etcd_access_addresses }} rm -r /registry"
|
|
|
|
environment:
|
|
|
|
ETCDCTL_API: 2
|
2017-03-23 18:10:42 +08:00
|
|
|
delegate_to: "{{groups['etcd'][0]}}"
|
2017-03-24 00:19:51 +08:00
|
|
|
run_once: true
|
2017-03-06 18:22:13 +08:00
|
|
|
when: kube_apiserver_storage_backend == "etcd3" and needs_etcd_migration|bool|default(false)
|