2016-07-08 09:59:21 +00:00
|
|
|
---
|
2017-03-06 10:22:13 +00:00
|
|
|
- name: "Pre-upgrade | etcd3 upgrade | see if old config exists"
|
|
|
|
command: "{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} ls /registry/minions"
|
|
|
|
environment:
|
|
|
|
ETCDCTL_API: 2
|
|
|
|
register: old_data_exists
|
2017-03-23 09:11:30 +00:00
|
|
|
delegate_to: "{{groups['etcd'][0]}}"
|
2017-03-06 10:22:13 +00:00
|
|
|
when: kube_apiserver_storage_backend == "etcd3"
|
|
|
|
failed_when: false
|
|
|
|
|
2017-08-20 10:54:28 +00:00
|
|
|
- name: "Pre-upgrade | etcd3 upgrade | use etcd2 unless forced to etcd3"
|
2017-03-30 13:08:13 +00:00
|
|
|
set_fact:
|
|
|
|
kube_apiserver_storage_backend: "etcd2"
|
|
|
|
when: old_data_exists.rc == 0 and not force_etcd3|bool
|
|
|
|
|
2017-09-15 12:19:37 +00:00
|
|
|
- name: "Pre-upgrade | Delete master manifests"
|
2017-03-27 11:44:21 +00:00
|
|
|
file:
|
2017-09-15 12:19:37 +00:00
|
|
|
path: "/etc/kubernetes/manifests/{{item}}.manifest"
|
2017-03-27 11:44:21 +00:00
|
|
|
state: absent
|
2017-09-25 11:19:04 +00:00
|
|
|
with_items:
|
2017-03-24 15:29:28 +00:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2016-12-13 09:03:35 +00:00
|
|
|
register: kube_apiserver_manifest_replaced
|
2017-09-09 20:41:20 +00:00
|
|
|
when: (secret_changed|default(false) or etcd_secret_changed|default(false))
|
2016-12-13 09:03:35 +00:00
|
|
|
|
2017-09-15 12:19:37 +00:00
|
|
|
- name: "Pre-upgrade | Delete master containers forcefully"
|
2017-03-27 11:44:21 +00:00
|
|
|
shell: "docker ps -f name=k8s-{{item}}* -q | xargs --no-run-if-empty docker rm -f"
|
2017-09-25 11:19:04 +00:00
|
|
|
with_items:
|
2017-03-27 11:44:21 +00:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2017-09-09 20:41:20 +00:00
|
|
|
when: kube_apiserver_manifest_replaced.changed
|
2017-07-27 17:46:21 +00:00
|
|
|
run_once: true
|