Improving controller boundaries and test reliability in Kubernetes

Written by Alessio on 10/2/2026

Problem

Some endpoint validation ran outside the reconciler that owns the endpoint lifecycle. Allocation checks and API server startup also needed clearer cancellation and timeout handling. In the test suite, an etcd failure test assumed iptables was available, client-go tests used deprecated polling, and some end-to-end assertions lacked operation context.

Changes

I moved endpoint IP validation into the reconciler and improved cancellation and timeout errors for IP and port allocation checks, including removal of a repair-controller timeout that could block kube-apiserver startup. I also updated an etcd failure test to use nftables with an iptables fallback, replaced wait.PollImmediate with Eventually, and clarified affected end-to-end error assertions.

Result

Validation runs at the endpoint lifecycle boundary, cancellation failures are clearer, and the tests rely less on one host networking setup. The test-only changes do not alter Kubernetes runtime behavior.

Commits: endpoint validation, cancellation and timeouts, nftables test, polling, assertions