2016-07-08 17:59:21 +08:00
|
|
|
---
|
2024-09-06 14:56:19 +08:00
|
|
|
- name: "Pre-upgrade | Delete control plane 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
|
2023-07-05 11:36:54 +08:00
|
|
|
when: etcd_secret_changed | default(false)
|
2016-12-13 17:03:35 +08:00
|
|
|
|
2024-09-06 14:56:19 +08:00
|
|
|
- name: "Pre-upgrade | Delete control plane containers forcefully" # noqa no-handler
|
2020-08-05 22:56:28 +08:00
|
|
|
shell: "set -o pipefail && docker ps -af name=k8s_{{ item }}* -q | xargs --no-run-if-empty docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
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
|
2024-09-06 14:56:19 +08:00
|
|
|
register: remove_control_plane_container
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 10
|
2024-09-06 14:56:19 +08:00
|
|
|
until: remove_control_plane_container.rc == 0
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|