v1.36.x: kube-apiserver crash-loops on upgrade (start-service-ip-repair-controllers fatal within 60s PostStartHook window)
Before creating an issue, make sure you've checked the following:
- You are running the latest released version of k0s
- Make sure you've searched for existing issues, both open and closed
- Make sure you've searched for PRs too, a fix might've been merged already
- You're looking at docs for the released version, "main" branch docs are usually ahead of released versions.
Platform
Linux 6.12.102-flatcar #1 SMP PREEMPT_DYNAMIC Tue Aug 11 23:10:58 -00 2026 x86_64 GNU/Linux
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=4593.2.5
VERSION_ID=4593.2.5
BUILD_ID=2026-08-12-0004
SYSEXT_LEVEL=1.0
PRETTY_NAME="Flatcar Container Linux by Kinvolk 4593.2.5 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar.org/"
BUG_REPORT_URL="https://issues.flatcar.org"
FLATCAR_BOARD="amd64-usr"
CPE_NAME="cpe:2.3:o:flatcar-linux:flatcar_linux:4593.2.5:*:*:*:*:*:*:*"Version
v1.35.7+k0s.0
Sysinfo
`k0s sysinfo`
Total memory: 7.7 GiB (pass)
File system of /var/lib/k0s: ext4 (pass)
Disk space available for /var/lib/k0s: 134.1 GiB (pass)
Relative disk space available for /var/lib/k0s: 94% (pass)
Name resolution: localhost: [::1 127.0.0.1] (pass)
Operating system: Linux (pass)
Linux kernel release: 6.12.102-flatcar (pass)
Max. file descriptors per process: current: 524287 / max: 524288 (pass)
AppArmor: unavailable (pass)
Executable in PATH: modprobe: /usr/sbin/modprobe (pass)
Executable in PATH: mount: /usr/sbin/mount (pass)
Executable in PATH: umount: /usr/sbin/umount (pass)
/proc file system: mounted (0x9fa0) (pass)
Control Groups: version 2 (pass)
cgroup controller "cpu": available (is a listed root controller) (pass)
cgroup controller "cpuacct": available (via cpu in version 2) (pass)
cgroup controller "cpuset": available (is a listed root controller) (pass)
cgroup controller "memory": available (is a listed root controller) (pass)
cgroup controller "devices": available (device filters attachable) (pass)
cgroup controller "freezer": available (cgroup.freeze exists) (pass)
cgroup controller "pids": available (is a listed root controller) (pass)
cgroup controller "hugetlb": available (is a listed root controller) (pass)
cgroup controller "blkio": available (via io in version 2) (pass)
CONFIG_CGROUPS: Control Group support: built-in (pass)
CONFIG_CGROUP_SCHED: Group CPU scheduler: built-in (pass)
CONFIG_FAIR_GROUP_SCHED: Group scheduling for SCHED_OTHER: built-in (pass)
CONFIG_CFS_BANDWIDTH: CPU bandwidth provisioning for FAIR_GROUP_SCHED: built-in (pass)
CONFIG_BLK_CGROUP: Block IO controller: built-in (pass)
CONFIG_NAMESPACES: Namespaces support: built-in (pass)
CONFIG_UTS_NS: UTS namespace: built-in (pass)
CONFIG_IPC_NS: IPC namespace: built-in (pass)
CONFIG_PID_NS: PID namespace: built-in (pass)
CONFIG_NET_NS: Network namespace: built-in (pass)
CONFIG_NET: Networking support: built-in (pass)
CONFIG_INET: TCP/IP networking: built-in (pass)
CONFIG_IPV6: The IPv6 protocol: built-in (pass)
CONFIG_NETFILTER: Network packet filtering framework (Netfilter): built-in (pass)
CONFIG_NETFILTER_ADVANCED: Advanced netfilter configuration: built-in (pass)
CONFIG_NF_CONNTRACK: Netfilter connection tracking support: module (pass)
CONFIG_NETFILTER_XTABLES: Netfilter Xtables support: built-in (pass)
CONFIG_NETFILTER_XT_TARGET_REDIRECT: REDIRECT target support: module (pass)
CONFIG_NETFILTER_XT_MATCH_COMMENT: "comment" match support: module (pass)
CONFIG_NETFILTER_XT_MARK: nfmark target and match support: module (pass)
CONFIG_NETFILTER_XT_SET: set target and match support: module (pass)
CONFIG_NETFILTER_XT_TARGET_MASQUERADE: MASQUERADE target support: module (pass)
CONFIG_NETFILTER_XT_NAT: "SNAT and DNAT" targets support: module (pass)
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: "addrtype" address type match support: module (pass)
CONFIG_NETFILTER_XT_MATCH_CONNTRACK: "conntrack" connection tracking match support: module (pass)
CONFIG_NETFILTER_XT_MATCH_MULTIPORT: "multiport" Multiple port match support: module (pass)
CONFIG_NETFILTER_XT_MATCH_RECENT: "recent" match support: module (pass)
CONFIG_NETFILTER_XT_MATCH_STATISTIC: "statistic" match support: module (pass)
CONFIG_NETFILTER_NETLINK: module (pass)
CONFIG_NF_NAT: module (pass)
CONFIG_IP_SET: IP set support: module (pass)
CONFIG_IP_SET_HASH_IP: hash:ip set support: module (pass)
CONFIG_IP_SET_HASH_NET: hash:net set support: module (pass)
CONFIG_IP_VS: IP virtual server support: module (pass)
CONFIG_IP_VS_NFCT: Netfilter connection tracking: built-in (pass)
CONFIG_IP_VS_SH: Source hashing scheduling: module (pass)
CONFIG_IP_VS_RR: Round-robin scheduling: module (pass)
CONFIG_IP_VS_WRR: Weighted round-robin scheduling: module (pass)
CONFIG_NF_CONNTRACK_IPV4: IPv4 connection tracking support (required for NAT): unknown (warning)
CONFIG_NF_REJECT_IPV4: IPv4 packet rejection: module (pass)
CONFIG_NF_NAT_IPV4: IPv4 NAT: unknown (warning)
CONFIG_IP_NF_IPTABLES: IP tables support: built-in (pass)
CONFIG_IP_NF_FILTER: Packet filtering: module (pass)
CONFIG_IP_NF_TARGET_REJECT: REJECT target support: module (pass)
CONFIG_IP_NF_NAT: iptables NAT support: module (pass)
CONFIG_IP_NF_MANGLE: Packet mangling: module (pass)
CONFIG_NF_DEFRAG_IPV4: module (pass)
CONFIG_NF_CONNTRACK_IPV6: IPv6 connection tracking support (required for NAT): unknown (warning)
CONFIG_NF_NAT_IPV6: IPv6 NAT: unknown (warning)
CONFIG_IP6_NF_IPTABLES: IP6 tables support: module (pass)
CONFIG_IP6_NF_FILTER: Packet filtering: module (pass)
CONFIG_IP6_NF_MANGLE: Packet mangling: module (pass)
CONFIG_IP6_NF_NAT: ip6tables NAT support: module (pass)
CONFIG_NF_DEFRAG_IPV6: module (pass)
CONFIG_BRIDGE: 802.1d Ethernet Bridging: module (pass)
CONFIG_LLC: module (pass)
CONFIG_STP: module (pass)
CONFIG_EXT4_FS: The Extended 4 (ext4) filesystem: module (pass)
CONFIG_PROC_FS: /proc file system support: built-in (pass)What happened?
While upgrading a prod cluster from v1.35.7+k0s.0 to v1.36.3+k0s.2 it left kube-apiserver in a permanent crash loop. The apiserver fatals ~60s after each start and k0s restarts the whole stack every ~2m. Rolling the k0s version back to
v1.35.7+k0s.0 recovered it almost immediately.
Searching through the issues here and on kubernetes, it looks like kubernetes/kubernetes#141220 surfaced "through" k0s. Opening here because k0s's supervisor turns this probably into an unrecoverable loop, and I'd like input on whether k0s could mitigate?
Every apiserver start dies at almost exactly 60s, alternating between two hooks:
F hooks.go:203] PostStartHook "start-service-ip-repair-controllers" failed:
unable to perform initial IP and Port allocation check
F hooks.go:203] PostStartHook "priority-and-fairness-config-producer" failed:
unable to initialize APF bootstrap configuration: timed out waiting for the conditionk0s then reports Process terminated unexpectedly: exit status 255 and restarts kine, konnectivity and the apiserver. Cycle repeats indefinitely.
Readyz never passes:
[-]poststarthook/start-service-ip-repair-controllers failed: not finished
[-]poststarthook/priority-and-fairness-config-producer failed: not finished
[-]autoregister-completion failed: missing APIService: [v1. v1.apps ...]The ServiceCIDR controller retries every 10s for the life of each process:
default_servicecidr_controller.go:170] "Creating default ServiceCIDR" CIDRs=["10.0.0.0/12"]
default_servicecidr_controller.go:206] "Inconsistent ServiceCIDR status"
serviceCIDR="" controllerCIDRs=["10.0.0.0/12"] serviceCIDRs=null
event: KubernetesDefaultServiceCIDRInconsistent
"The default ServiceCIDR [] does not match the controller flag configurations [10.0.0.0/12]"Also present shortly before each fatal (nodeport repair loop):
E repair.go:201] "Unhandled Error" err="the node port 32041 may have leaked: flagging for later clean up"
E repair.go:201] ... 32097 ... 32199 ... 32360 ... 32464Probably not a problem
Ruled these out while debugging, in case it saves anyone time:
- Storage. kine served 31k+ successful queries throughout (
kine_sql_time_seconds_count{error_code=""}); the apiserver's gRPC errors withkine.sockis teardown noise as it exits. - Version skew. This was the first and only 1.36 start; it failed identically from the very first attempt.
- Admission webhooks. None installed, so kubernetes#137356 doesn't apply.
- Dual-stack. Single-stack IPv4, so k0s#7927 doesn't apply.
kubernetes#141220
That issue describes doRunOnce() in the nodeport repair controller LISTing Services with no retry, while wait.Until sleeps repairLoopInterval = 3m on error and the hook only waits time.After(time.Minute). Retry interval > hook
deadline, so a single transient error in the first 60s is unrecoverable. The reported workaround is --watch-cache-sizes=services#0.
This seems to match my failure exactly. The ServiceCIDR object is never written and in consequence: the apiserver keeps dying before it can finish.
Steps to reproduce
- Upgrade from k0s 1.35.x to 1.36.x
Expected behavior
Successful upgrade
Actual behavior
API server dies
Screenshots and logs
No response
Additional context
I was wondering about the following:
- Should/Could k0s ship a mitigation (e.g. defaulting
watch-cache-sizes=services#0on affected versions), or is this purely upstream to fix? - Is there a supported workaround (other to staying on 1.35.x)? Creating the ServiceCIDR object needs a working apiserver, and the apiserver won't survive 60s without it.
- Would it be reasonable for k0s's supervisor to surface the underlying
Fline more prominently? I enabledspec.api.extraArgs.v: "2"to get clarity, but the fatal is drowned in thousands of healthz/readyz lines, which made this much slower to find.
Source: k0sproject/k0s