diff --git a/infrastructure/host/systemd/k3s.service.d/10-after-time-sync.conf b/infrastructure/host/systemd/k3s.service.d/10-after-time-sync.conf new file mode 100644 index 0000000..05b4891 --- /dev/null +++ b/infrastructure/host/systemd/k3s.service.d/10-after-time-sync.conf @@ -0,0 +1,9 @@ +# Start k3s only after the system clock is synchronized. +# k3s writes certificates with the current time at start. If the clock is +# wrong at boot (RTC read 9 hours ahead on 2026-11-11) and NTP corrects it +# later, those certificates are "not yet valid" and every Ingress returns 502. +# time-sync.target is reached only when systemd-time-wait-sync.service is +# enabled. See infrastructure/host/README.md. +[Unit] +Wants=time-sync.target +After=time-sync.target diff --git a/infrastructure/host/systemd/systemd-time-wait-sync.service.d/10-timeout.conf b/infrastructure/host/systemd/systemd-time-wait-sync.service.d/10-timeout.conf new file mode 100644 index 0000000..3d1993d --- /dev/null +++ b/infrastructure/host/systemd/systemd-time-wait-sync.service.d/10-timeout.conf @@ -0,0 +1,5 @@ +# The packaged unit waits forever (TimeoutStartSec=infinity). If NTP is not +# reachable at boot, k3s would never start. After 10 minutes this unit fails, +# time-sync.target is reached anyway, and k3s starts with the clock it has. +[Service] +TimeoutStartSec=10min