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:
2026-10-25 14:44:22 +00:00
parent 4c39069241
commit 8a0c8fb31b
3 changed files with 86 additions and 5 deletions
+20
View File
@@ -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