2016-07-08 17:59:21 +08:00
|
|
|
---
|
2019-04-24 15:08:05 +08:00
|
|
|
- name: "Pre-upgrade | Delete master manifests if etcd secrets changed"
|
2017-03-27 19:44:21 +08:00
|
|
|
file:
|
2019-05-03 05:24:21 +08:00
|
|
|
path: "/etc/kubernetes/manifests/{{ item }}.manifest"
|
2017-03-27 19:44:21 +08:00
|
|
|
state: absent
|
2017-09-25 19:19:04 +08:00
|
|
|
with_items:
|
2017-03-24 23:29:28 +08:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2016-12-13 17:03:35 +08:00
|
|
|
register: kube_apiserver_manifest_replaced
|
2019-04-24 15:08:05 +08:00
|
|
|
when: etcd_secret_changed|default(false)
|
2016-12-13 17:03:35 +08:00
|
|
|
|
2017-09-15 20:19:37 +08:00
|
|
|
- name: "Pre-upgrade | Delete master containers forcefully"
|
2019-05-03 05:24:21 +08:00
|
|
|
shell: "docker ps -af name=k8s_{{ item }}* -q | xargs --no-run-if-empty docker rm -f"
|
2017-09-25 19:19:04 +08:00
|
|
|
with_items:
|
2017-03-27 19:44:21 +08:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2017-09-10 04:41:20 +08:00
|
|
|
when: kube_apiserver_manifest_replaced.changed
|
2018-03-30 00:37:32 +08:00
|
|
|
register: remove_master_container
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 10
|
2018-03-30 00:37:32 +08:00
|
|
|
until: remove_master_container.rc == 0
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|