Slowdown apimaster restart
This commit is contained in:
parent
8676f8761f
commit
4566d60e6f
3 changed files with 26 additions and 19 deletions
|
@ -1,16 +1,4 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: restart kube-apiserver
|
- name: restart kube-apiserver
|
||||||
command: /bin/true
|
set_fact:
|
||||||
notify:
|
restart_apimaster: True
|
||||||
- reload systemd
|
|
||||||
- reload kube-apiserver
|
|
||||||
|
|
||||||
- name: reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
when: init_system == "systemd"
|
|
||||||
|
|
||||||
- name: reload kube-apiserver
|
|
||||||
service:
|
|
||||||
name: kube-apiserver
|
|
||||||
state: restarted
|
|
||||||
|
|
|
@ -76,11 +76,9 @@
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Enable apiserver
|
- include: start.yml
|
||||||
service:
|
with_items: groups['kube-master']
|
||||||
name: kube-apiserver
|
when: "{{ hostvars[item].inventory_hostname == inventory_hostname }}"
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
|
|
||||||
# Create kube-system namespace
|
# Create kube-system namespace
|
||||||
- name: copy 'kube-system' namespace manifest
|
- name: copy 'kube-system' namespace manifest
|
||||||
|
|
21
roles/kubernetes/master/tasks/start.yml
Normal file
21
roles/kubernetes/master/tasks/start.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
---
|
||||||
|
- name: Pause
|
||||||
|
pause: seconds=10
|
||||||
|
|
||||||
|
- name: reload systemd
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
when: init_system == "systemd" and restart_apimaster is defined and restart_apimaster == True
|
||||||
|
|
||||||
|
- name: reload kube-apiserver
|
||||||
|
service:
|
||||||
|
name: kube-apiserver
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when: restart_apimaster is defined and restart_apimaster == True
|
||||||
|
|
||||||
|
- name: Enable apiserver
|
||||||
|
service:
|
||||||
|
name: kube-apiserver
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
when: restart_apimaster is not defined or restart_apimaster == False
|
Loading…
Reference in a new issue