2015-10-04 04:19:50 +08:00
|
|
|
---
|
2016-08-01 21:12:23 +08:00
|
|
|
- name: Master | reload systemd
|
2024-07-26 16:11:39 +08:00
|
|
|
systemd_service:
|
2019-04-24 13:18:00 +08:00
|
|
|
daemon_reload: true
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | restart kubelet
|
2016-08-01 21:12:23 +08:00
|
|
|
|
|
|
|
- name: Master | reload kubelet
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
state: restarted
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | restart kubelet
|
2016-08-01 21:12:23 +08:00
|
|
|
|
2019-10-17 09:58:39 +08:00
|
|
|
- name: Master | Remove apiserver container docker
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && docker ps -af name=k8s_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_apiserver_container
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 10
|
2017-12-13 02:06:41 +08:00
|
|
|
until: remove_apiserver_container.rc == 0
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|
2019-10-17 09:58:39 +08:00
|
|
|
when: container_manager == "docker"
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart apiserver
|
2017-11-08 15:40:33 +08:00
|
|
|
|
2019-10-17 09:58:39 +08:00
|
|
|
- name: Master | Remove apiserver container containerd/crio
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ bin_dir }}/crictl pods --name kube-apiserver* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2019-10-17 09:58:39 +08:00
|
|
|
register: remove_apiserver_container
|
|
|
|
retries: 10
|
|
|
|
until: remove_apiserver_container.rc == 0
|
|
|
|
delay: 1
|
|
|
|
when: container_manager in ['containerd', 'crio']
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart apiserver
|
2019-10-17 09:58:39 +08:00
|
|
|
|
|
|
|
- name: Master | Remove scheduler container docker
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -af name=k8s_kube-scheduler* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_scheduler_container
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 10
|
2017-12-13 02:06:41 +08:00
|
|
|
until: remove_scheduler_container.rc == 0
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|
2019-10-17 09:58:39 +08:00
|
|
|
when: container_manager == "docker"
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart kube-scheduler
|
2017-11-08 15:40:33 +08:00
|
|
|
|
2019-10-17 09:58:39 +08:00
|
|
|
- name: Master | Remove scheduler container containerd/crio
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ bin_dir }}/crictl pods --name kube-scheduler* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2019-10-17 09:58:39 +08:00
|
|
|
register: remove_scheduler_container
|
|
|
|
retries: 10
|
|
|
|
until: remove_scheduler_container.rc == 0
|
|
|
|
delay: 1
|
|
|
|
when: container_manager in ['containerd', 'crio']
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart kube-scheduler
|
2019-10-17 09:58:39 +08:00
|
|
|
|
|
|
|
- name: Master | Remove controller manager container docker
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -af name=k8s_kube-controller-manager* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_cm_container
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 10
|
2017-12-13 02:06:41 +08:00
|
|
|
until: remove_cm_container.rc == 0
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|
2019-10-17 09:58:39 +08:00
|
|
|
when: container_manager == "docker"
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart kube-controller-manager
|
2019-10-17 09:58:39 +08:00
|
|
|
|
|
|
|
- name: Master | Remove controller manager container containerd/crio
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ bin_dir }}/crictl pods --name kube-controller-manager* -q | xargs -I% --no-run-if-empty bash -c '{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %'"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2019-10-17 09:58:39 +08:00
|
|
|
register: remove_cm_container
|
|
|
|
retries: 10
|
|
|
|
until: remove_cm_container.rc == 0
|
|
|
|
delay: 1
|
|
|
|
when: container_manager in ['containerd', 'crio']
|
2023-11-08 19:28:30 +08:00
|
|
|
listen: Master | Restart kube-controller-manager
|
2017-11-08 15:40:33 +08:00
|
|
|
|
2016-09-27 17:54:12 +08:00
|
|
|
- name: Master | wait for kube-scheduler
|
2020-12-18 23:38:25 +08:00
|
|
|
vars:
|
|
|
|
endpoint: "{{ kube_scheduler_bind_address if kube_scheduler_bind_address != '0.0.0.0' else 'localhost' }}"
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
2020-12-18 23:38:25 +08:00
|
|
|
url: https://{{ endpoint }}:10259/healthz
|
2024-08-28 13:30:56 +08:00
|
|
|
validate_certs: false
|
2016-08-01 21:12:23 +08:00
|
|
|
register: scheduler_result
|
|
|
|
until: scheduler_result.status == 200
|
2017-03-27 19:44:21 +08:00
|
|
|
retries: 60
|
2019-04-24 15:08:05 +08:00
|
|
|
delay: 1
|
2023-11-08 19:28:30 +08:00
|
|
|
listen:
|
|
|
|
- Master | restart kubelet
|
|
|
|
- Master | Restart kube-scheduler
|
2016-08-01 21:12:23 +08:00
|
|
|
|
2016-09-27 17:54:12 +08:00
|
|
|
- name: Master | wait for kube-controller-manager
|
2020-12-18 23:38:25 +08:00
|
|
|
vars:
|
|
|
|
endpoint: "{{ kube_controller_manager_bind_address if kube_controller_manager_bind_address != '0.0.0.0' else 'localhost' }}"
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
2020-12-18 23:38:25 +08:00
|
|
|
url: https://{{ endpoint }}:10257/healthz
|
2024-08-28 13:30:56 +08:00
|
|
|
validate_certs: false
|
2016-08-01 21:12:23 +08:00
|
|
|
register: controller_manager_result
|
|
|
|
until: controller_manager_result.status == 200
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 60
|
|
|
|
delay: 1
|
2023-11-08 19:28:30 +08:00
|
|
|
listen:
|
|
|
|
- Master | restart kubelet
|
|
|
|
- Master | Restart kube-controller-manager
|
2016-09-27 17:54:12 +08:00
|
|
|
|
|
|
|
- name: Master | wait for the apiserver to be running
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
2017-11-07 04:01:10 +08:00
|
|
|
url: "{{ kube_apiserver_endpoint }}/healthz"
|
2024-08-28 13:30:56 +08:00
|
|
|
validate_certs: false
|
2016-09-27 17:54:12 +08:00
|
|
|
register: result
|
|
|
|
until: result.status == 200
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 60
|
|
|
|
delay: 1
|
2023-11-08 19:28:30 +08:00
|
|
|
listen:
|
|
|
|
- Master | restart kubelet
|
|
|
|
- Master | Restart apiserver
|