Skip to content

Commit dede3bf

Browse files
committed
release: prepend logind configuration with number
Kubelet is hardcoded to create a 99-kubelet.conf[1] file when the current InhibitDelayMaxSec is lower than the requested shutdownGracePeriod[2]. Kubelet then reloads systemd-logind and checks that its requested InhibitDelayMaxSec has been applied. Logind will gather all drop-in files and merge lexicographically[3], with later files taking precedence on settings over earlier ones; the current filename of `systemd-logind.conf` will _always_ have its InhibitDelayMaxSec set over `99-kubelet.conf`. This results in kubelet failing to set up an inhibition lock when setting settings.kubernetes.shutdown-grace-period>=300. Following this change, the InhibitDelayMaxSec set in the image still applies but can be overridden when by kubelet as `99-kubelet.conf` will take precedence. [1] https://github.com/kubernetes/kubernetes/blob/release-1.33/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go#L173-L176 [2] https://github.com/kubernetes/kubernetes/blob/release-1.33/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go#L185 [3] https://www.freedesktop.org/software/systemd/man/latest/logind.conf.html
1 parent dbe57db commit dede3bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/release/release.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ install -d %{buildroot}%{_cross_libdir}/systemd/network
202202
install -p -m 0644 %{S:1200} %{buildroot}%{_cross_libdir}/systemd/network/80-release.link
203203

204204
install -d %{buildroot}%{_cross_libdir}/systemd/logind.conf.d
205-
install -p -m 0644 %{S:1103} %{buildroot}%{_cross_libdir}/systemd/logind.conf.d/systemd-logind.conf
205+
install -p -m 0644 %{S:1103} %{buildroot}%{_cross_libdir}/systemd/logind.conf.d/80-inhibit-maxdelay.conf
206206

207207
cat >%{buildroot}%{_cross_libdir}/os-release <<EOF
208208
NAME=Bottlerocket
@@ -302,7 +302,7 @@ ln -s preconfigured.target %{buildroot}%{_cross_unitdir}/default.target
302302
%{_cross_libdir}/os-release
303303
%dir %{_cross_libdir}/repart.d
304304
%{_cross_libdir}/repart.d/80-local.conf
305-
%{_cross_libdir}/systemd/logind.conf.d/systemd-logind.conf
305+
%{_cross_libdir}/systemd/logind.conf.d/80-inhibit-maxdelay.conf
306306
%{_cross_libdir}/systemd/network/80-release.link
307307
%{_cross_libdir}/systemd/networkd.conf.d/80-release.conf
308308
%{_cross_libdir}/systemd/system.conf.d/80-release.conf

0 commit comments

Comments
 (0)