kubernetes: kubelet_reserved drop-in 30-reserved.conf and a k3s restart handler that runs only with k3s_restart_allowed
This commit is contained in:
@@ -17,3 +17,23 @@
|
||||
- name: wait_for_connection
|
||||
wait_for_connection:
|
||||
delay: 5
|
||||
|
||||
# Restarts the kubelet to read changed drop-ins. Runs only with
|
||||
# -e k3s_restart_allowed=true; node.yml refuses it for more than one host.
|
||||
- name: restart_k3s
|
||||
ansible.builtin.service:
|
||||
name: k3s
|
||||
state: restarted
|
||||
when:
|
||||
- k3s_restart_allowed | default(false) | bool
|
||||
- not ansible_check_mode
|
||||
notify: wait_for_k3s
|
||||
|
||||
- name: wait_for_k3s
|
||||
command: k3s kubectl get --raw /readyz
|
||||
register: k3s_readyz
|
||||
until: k3s_readyz.rc == 0 and k3s_readyz.stdout == 'ok'
|
||||
retries: 30
|
||||
delay: 10
|
||||
changed_when: false
|
||||
when: not ansible_check_mode
|
||||
|
||||
Reference in New Issue
Block a user