Repository navigation
fix(kpr): supervise the svc_vips reconciler, and give it the configured endpoint - #57
Merged
Merged
Conversation
…ed endpoint
A woken stand ran 25 hours with every kpr pod Running and Ready and nothing
reconciling Services. Reported from the integration stand; two defects behind
one symptom.
The reconciler dialed the apiserver through rest.InClusterConfig(), i.e.
kubernetes.default's ClusterIP — a VIP that, with kube-proxy gone, kpr itself
programs. So during boot it was dialling the one address it is responsible for
serving, and timed out. chart/cozyplane-kpr already carries apiServerURL for
this, and values-talos.yaml already points it at KubePrism, but that value
reached only Cilium's hive through --k8s-api-server-urls; the net-0 reconciler
never read the flag. It does now, parsed as Cilium parses it (a bare host:port
means https), keeping the in-cluster CA and token.
And the exit was terminal. `go func() { if err := run(); err != nil { log } }()`
turns one transient error into a permanently dead worker, with nothing to notice
it: kpr has no readiness probe, the process stayed up, and the pod went on
advertising itself as healthy while the datapath kept whatever Service state it
held at the moment of the exit. It runs under runWithRestart now — capped
exponential backoff, reset once a run has stayed up, stopping only on context
cancellation. Re-running is the recovery: the pin waits already retry in a loop
and seed() is a full pass that sweeps leftovers, so every stage is idempotent.
Unit-tested both: that an exiting run is restarted (error and nil alike), that a
cancelled context neither starts nor spins, that the backoff is capped, and that
the endpoint flag resolves the way the chart's values expect.
Refs: docs/bringup-field-notes.md §13
Assisted-by: LLM
Signed-off-by: Timofei Larkin <[email protected]>
lllamnyp
added a commit
to cozystack/cozystack
that referenced
this pull request
Oct 16, 2026
Re-vendor from upstream main: kpr's svc_vips reconciler is supervised and dials the configured apiserver endpoint rather than dying silently with the default one (lllamnyp/cozyplane#57), and the agent re-creates the FabricIP claim of a pod that already holds the address instead of wedging it (lllamnyp/cozyplane#58). Both are binary fixes, so both image pins move; the charts themselves are unchanged. Assisted-by: LLM Signed-off-by: Timofei Larkin <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported from the integration stand (addendum item 2e). A stand was parked and woken by the TTL automation; every
cozyplane-kprpod came up, attached its socket-LB programs, and ~30 s later loggedthen stayed Running and Ready for 25 hours with nothing reconciling. No Service change reached the datapath in that window — the root ingress Service's node-owned externalIPs were refused on every node, including the two with a Ready ingress pod, and pods created after the wake were never added as backends.
rollout restartfixed it instantly.Two defects, one symptom.
It dialed a VIP it is itself responsible for.
10.96.0.1iskubernetes.default's ClusterIP, which with kube-proxy gone kpr programs. The reconciler calledrest.InClusterConfig()unconditionally, so during boot it dialed the one address it had not yet served.chart/cozyplane-kpralready hasapiServerURLfor this andvalues-talos.yamlalready points it at KubePrism — but that value reached only Cilium's hive, via--k8s-api-server-urls. cozyplane's own net-0 reconciler never read the flag. It does now, parsed as Cilium parses it (a barehost:portmeans https), keeping the in-cluster CA and token.The exit was terminal.
go func() { if err := run(); err != nil { log } }()turns one transient error into a permanently dead worker with nothing to notice it: kpr has no readiness probe, the process stays up, and the pod goes on advertising health. It runs underrunWithRestartnow — capped exponential backoff, reset once a run has stayed up, stopping only on context cancellation. Re-running is the recovery path: the pin waits already retry in a loop andseed()is a full pass that sweeps leftovers, so every stage is idempotent.Unit tests cover both halves: an exiting run is restarted (error and
nilalike), a cancelled context neither starts a run nor spins, the backoff is capped, and the endpoint flag resolves the way the chart's values expect (including the bare-host:portand unset cases).The addendum offered "restart with backoff inside the process, or fail the readiness probe and exit". In-process restart is the one implemented: recovery is faster, and the probe option would mean adding a probe endpoint and a chart stanza that do not exist today.
Detail and the lesson in
docs/bringup-field-notes.md§13.