2015-10-04 04:19:50 +08:00
|
|
|
---
|
2016-08-01 21:12:23 +08:00
|
|
|
- name: Master | restart kubelet
|
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2016-08-25 17:16:14 +08:00
|
|
|
- Master | reload systemd
|
|
|
|
- Master | reload kubelet
|
2016-09-27 17:54:12 +08:00
|
|
|
- Master | wait for master static pods
|
2016-08-01 21:12:23 +08:00
|
|
|
|
2016-09-27 17:54:12 +08:00
|
|
|
- name: Master | wait for master static pods
|
2016-08-01 21:12:23 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2016-09-27 17:54:12 +08:00
|
|
|
- Master | wait for the apiserver to be running
|
|
|
|
- Master | wait for kube-scheduler
|
|
|
|
- Master | wait for kube-controller-manager
|
2016-08-01 21:12:23 +08:00
|
|
|
|
2017-11-08 15:40:33 +08:00
|
|
|
- name: Master | Restart apiserver
|
|
|
|
command: /bin/true
|
|
|
|
notify:
|
|
|
|
- Master | Remove apiserver container
|
|
|
|
- Master | wait for the apiserver to be running
|
|
|
|
|
|
|
|
- name: Master | Restart kube-scheduler
|
|
|
|
command: /bin/true
|
|
|
|
notify:
|
|
|
|
- Master | Remove scheduler container
|
|
|
|
- Master | wait for kube-scheduler
|
|
|
|
|
|
|
|
- name: Master | Restart kube-controller-manager
|
|
|
|
command: /bin/true
|
|
|
|
notify:
|
|
|
|
- Master | Remove controller manager container
|
|
|
|
- Master | wait for kube-controller-manager
|
|
|
|
|
2016-08-01 21:12:23 +08:00
|
|
|
- name: Master | reload systemd
|
2019-04-24 13:18:00 +08:00
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
2016-08-01 21:12:23 +08:00
|
|
|
|
|
|
|
- name: Master | reload kubelet
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
state: restarted
|
|
|
|
|
2017-11-08 15:40:33 +08:00
|
|
|
- name: Master | Remove apiserver container
|
|
|
|
shell: "docker ps -af name=k8s_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_apiserver_container
|
|
|
|
retries: 4
|
|
|
|
until: remove_apiserver_container.rc == 0
|
|
|
|
delay: 5
|
2017-11-08 15:40:33 +08:00
|
|
|
|
|
|
|
- name: Master | Remove scheduler container
|
|
|
|
shell: "docker ps -af name=k8s_kube-scheduler* -q | xargs --no-run-if-empty docker rm -f"
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_scheduler_container
|
|
|
|
retries: 4
|
|
|
|
until: remove_scheduler_container.rc == 0
|
|
|
|
delay: 5
|
2017-11-08 15:40:33 +08:00
|
|
|
|
|
|
|
- name: Master | Remove controller manager container
|
|
|
|
shell: "docker ps -af name=k8s_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_cm_container
|
|
|
|
retries: 4
|
|
|
|
until: remove_cm_container.rc == 0
|
|
|
|
delay: 5
|
2017-11-08 15:40:33 +08:00
|
|
|
|
2016-09-27 17:54:12 +08:00
|
|
|
- name: Master | wait for kube-scheduler
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
|
|
|
url: http://localhost:10251/healthz
|
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
|
2016-08-01 21:12:23 +08:00
|
|
|
delay: 5
|
|
|
|
|
2016-09-27 17:54:12 +08:00
|
|
|
- name: Master | wait for kube-controller-manager
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
|
|
|
url: http://localhost:10252/healthz
|
2016-08-01 21:12:23 +08:00
|
|
|
register: controller_manager_result
|
|
|
|
until: controller_manager_result.status == 200
|
|
|
|
retries: 15
|
|
|
|
delay: 5
|
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"
|
|
|
|
validate_certs: no
|
|
|
|
client_cert: "{{ kube_apiserver_client_cert }}"
|
|
|
|
client_key: "{{ kube_apiserver_client_key }}"
|
2016-09-27 17:54:12 +08:00
|
|
|
register: result
|
|
|
|
until: result.status == 200
|
2018-02-12 15:35:29 +08:00
|
|
|
retries: 30
|
|
|
|
delay: 10
|
2017-09-14 02:00:51 +08:00
|
|
|
|
|
|
|
- name: Master | set secret_changed
|
2017-10-12 16:55:46 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
|
|
|
- Master | set secret_changed to true
|
2018-12-06 18:33:38 +08:00
|
|
|
- Master | Copy new kubeconfig for root user
|
2017-10-12 16:55:46 +08:00
|
|
|
|
|
|
|
- name: Master | set secret_changed to true
|
2017-09-14 02:00:51 +08:00
|
|
|
set_fact:
|
|
|
|
secret_changed: true
|
2017-10-12 16:55:46 +08:00
|
|
|
|
2018-12-06 18:33:38 +08:00
|
|
|
- name: Master | Copy new kubeconfig for root user
|
|
|
|
copy:
|
|
|
|
src: "{{ kube_config_dir }}/admin.conf"
|
|
|
|
dest: "/root/.kube/config"
|
|
|
|
remote_src: yes
|
|
|
|
mode: "0600"
|
|
|
|
backup: yes
|