Repository navigation
refactor(sdk): shared WatchSet, one watch and cache per kind - #524
Merged
Merged
Conversation
…9 §3, roadmap 01 Phase B step B2) One watcher per (kind, namespace target) in sdk::watch keeps the store and fans out every InitApply/Apply/Delete to subscribed controllers (async-broadcast: backpressure, never loss; late subscribers get the store replayed; ended streams restart with backoff; watch metrics). Controllers consume it via for_stream / watches_stream / owns_stream (kube-runtime unstable-runtime-stream-control, the only unstable feature enabled); uncached owned kinds keep ordinary watches. About 57 -> 19 watch connections cluster-wide. ADR-0009 §3 amended first: kube's store_shared never dispatches Delete events, which .owns() and the zone controller need. Fix: the zone controller watched Endpoints with Api::all in every mode, which namespace-restricted RBAC does not grant, so a replaced BIND9 pod waited for the zone's requeue. Endpoints of bindy's Services are now a label-selected WatchSet kind, one watch per namespace; the zone controller subscribes to Endpoints and Bind9Instance across all namespaces (subscribe_all) for cross-namespace zones. No RBAC change. Tooling: kind targets run with KUBECONFIG set to a dedicated ~/.kube/kind-bindy.yaml (KIND_KUBECONFIG; default path in CI), so a kind run can no longer write into the caller's kubeconfig. Docs: ADR-0009 amended, roadmap 01 and ROADMAPS.md, architecture watching section, threat model v1.8 (M-38, residual risk 7), testing guide. 1623 tests pass (1609 + 14 new). Signed-off-by: Erick Bourgeois <erick@jeb.ca>
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.
refactor(sdk): shared WatchSet, one watch and cache per kind