r/kubelet: Pass --config arg to service

The systemd unit configuration installed by Fedora's _kubeadm_ package
does not pass the `--config` argument to the kubelet service.  Without
this argument, the kubelet will not read the configuration file
generated by `kubeadm` from the `kubelet-config` ConfigMap.  Thus,
various features will not work correctly, including server TLS
bootstrap.
dynamic-inventory
Dustin 2024-12-07 09:35:57 -06:00
parent d2e8b9237f
commit 15cb675297
3 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,2 @@
[Service]
Environment=KUBELET_EXTRA_ARGS='--config=/var/lib/kubelet/config.yaml'

View File

@ -9,3 +9,8 @@
- name: swapoff -a - name: swapoff -a
command: command:
swapoff -a swapoff -a
- name: restart kubelet
service:
name: kubelet
state: restarted

View File

@ -84,6 +84,28 @@
tags: tags:
- cni - cni
- name: ensure kubelet.service drop-in configuration directory exists
file:
path: /etc/systemd/system/kubelet.service.d
owner: root
group: root
mode: u=rwx,go=rx
state: directory
tags:
- systemd
- name: ensure kubelet.service extra args are configured
copy:
src: extra-args.systemd.conf
dest: /etc/systemd/system/kubelet.service.d/60-extra-args.conf
owner: root
group: root
mode: u=rw,go=r
notify:
- reload systemd
- restart kubelet
tags:
- systemd
- name: ensure kubelet service is enabled - name: ensure kubelet service is enabled
service: service:
name: kubelet name: kubelet