Edited kubelet configmap in kube-system namespace but this config change doesn't seem to be propagated to existing nodes. I guess it only affects newly joinet Kubernetes nodes
Added Ansible playbook to reconfigure existing nodes f9393fd0da
Tried systemctl daemon-reload and node reboot but still node immediately shuts down without marking it not ready and allowing time to drain the pods
The file /etc/systemd/logind.conf.d/99-kubelet.conf on nodes shows:
[Login]
InhibitDelayMaxSec=300
But systemd-inhibit --list doesn't show anything kubelet related
Nodes are Ubuntu 22.04 at the moment, but this looks like more reasons to move to Flatcar
Not sure what is missing from https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2000-graceful-node-shutdown
Basically what has been tried:
* Edited kubelet configmap in kube-system namespace but this config change doesn't seem to be propagated to existing nodes. I guess it only affects newly joinet Kubernetes nodes
* Added Ansible playbook to reconfigure existing nodes https://git.k-space.ee/k-space/kube/commit/f9393fd0dac12a5e27eaf195d27cabcf376d9701
Tried `systemctl daemon-reload` and node reboot but still node immediately shuts down without marking it not ready and allowing time to drain the pods
The file `/etc/systemd/logind.conf.d/99-kubelet.conf` on nodes shows:
```# Kubelet logind override
[Login]
InhibitDelayMaxSec=300
```
But `systemd-inhibit --list` doesn't show anything kubelet related
Nodes are Ubuntu 22.04 at the moment, but this looks like more reasons to move to Flatcar
Ubuntu by default has unattended-upgrades installed that contains /lib/systemd/logind.conf.d/unattended-upgrades-logind-maxdelay.conf file with InhibitDelayMaxSec config option.
systemd-logind sorts all the files in its config directories and will pick the config value from last file.
Files in the *.conf.d/ configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files.
This means that unattended-upgrades-logind-maxdelay.conf will overwrite 99-kubelet.conf InhibitDelayMaxSec.
Ubuntu by default has `unattended-upgrades` installed that contains `/lib/systemd/logind.conf.d/unattended-upgrades-logind-maxdelay.conf` file with `InhibitDelayMaxSec` config option.
[Kubelet writes its DelayMaxSec](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go#L175) into file called `99-kubelet.conf`
systemd-logind sorts all the files in its config directories and will pick the config value from last file.
> Files in the *.conf.d/ configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files.
This means that `unattended-upgrades-logind-maxdelay.conf` will overwrite `99-kubelet.conf` InhibitDelayMaxSec.
Fix is to rename 99-kubelet.conf to zz-kubelet.conf so that is loaded last https://github.com/kubernetes/kubernetes/issues/107043#issuecomment-1023756350
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Not sure what is missing from https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2000-graceful-node-shutdown
Basically what has been tried:
f9393fd0daTried
systemctl daemon-reloadand node reboot but still node immediately shuts down without marking it not ready and allowing time to drain the podsThe file
/etc/systemd/logind.conf.d/99-kubelet.confon nodes shows:But
systemd-inhibit --listdoesn't show anything kubelet relatedNodes are Ubuntu 22.04 at the moment, but this looks like more reasons to move to Flatcar
Ubuntu by default has
unattended-upgradesinstalled that contains/lib/systemd/logind.conf.d/unattended-upgrades-logind-maxdelay.conffile withInhibitDelayMaxSecconfig option.Kubelet writes its DelayMaxSec into file called
99-kubelet.confsystemd-logind sorts all the files in its config directories and will pick the config value from last file.
This means that
unattended-upgrades-logind-maxdelay.confwill overwrite99-kubelet.confInhibitDelayMaxSec.Fix is to rename 99-kubelet.conf to zz-kubelet.conf so that is loaded last https://github.com/kubernetes/kubernetes/issues/107043#issuecomment-1023756350
Now tracked on https://github.com/kubernetes/kubernetes/issues/102818