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