Sites exchange their own static and Kubernetes-generated DNS records directly. Imported DNS records are never re-exported or stored in Kubernetes. Site IDs and node endpoints propagate transitively, forming a cooperating mesh when operators supply credentials. Peer sync extends DNS on TCP 53; ordinary queries use UDP/TCP 53. BIND cannot provide this complete-local-catalogue protocol. See wire v4.
Identities, endpoints and credentials
Use a stable unique CLUSTER_ID per Kubernetes cluster/site, shared by its pods. A
PeerSite represents one remote ID with alternative ordered node IP endpoints, not one
object per node. IDs are case-sensitive. Bare IPs use TCP53; explicit IP:port is
supported. DNS uses a DaemonSet behind a Service with externalIPs; remote endpoints must
route through the Service to ready DNS pods.
TSIG is shared-secret DNS authentication, not public-key cryptography. The application generates a local key automatically if its Secret is absent on initial startup. The private export looks like:
{"keyName":"site-west.","algorithm":"hmac-sha256.","secret":"MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY="}
The example is documentation data. Generate real keys in the application. The name is an identifier, not a DNS record. The base64 secret is private; it must not be published like a public key. TSIG authenticates/integrity-protects messages, without encrypting records. No external key tool or service is required.
Each direction is independent:
| Transfer | Credential stored at receiver |
|---|---|
| A fetches B's records | A stores B's local key. |
| B fetches A's records | B stores A's local key. |
The exporting site verifies only its current local key. It does not require a reciprocal PeerSite or the receiver's outbound credential. Anyone holding that local key can fetch the complete local snapshot; it does not identify distinct requesters or limit zones. Shared secret holders can impersonate that site's signatures, so distribute keys only within the intended trust relationship.
Bootstrap a connection
- Create a PeerSite in the administration namespace using the remote site ID and one reachable node IP. Supply several bootstrap IPs if convenient.
- On the remote site's TSIG keys tab, choose Export private key.
- Privately import that bundle for the PeerSite in this site's Peer sites tab, or provision its referenced Kubernetes Secret through GitOps/ESO.
- Wait for successful direct synchronization. The authenticated topology replaces bootstrap addresses with the remote site's current complete list.
- Provision the reverse direction separately if both sites should import data.
A site without a credential is Pending credentials; it neither sends unsigned transfers nor blocks startup indefinitely. A completed pending/disabled check counts as the initial readiness attempt. After provisioning a key, reload triggers a transfer automatically. Individual PeerSite objects and Secrets may be owned by UI, GitOps or external-secret automation. Resource versions protect concurrent writes; they do not resolve conflicting controller ownership.
Transitive discovery and persisted metadata
If A contacts B and B knows C/D, A learns C/D's site identities and endpoints. It persists PeerSites for them, without receiving C/D's imported DNS records or keys. Those sites remain pending until an administrator/automation supplies their credentials. A then contacts C/D directly for their local DNS snapshots. The same model applies viewed from every site and in each direction.
Each site advertises its Node ExternalIPs that also appear in the configured DNS Service externalIPs and enabled known PeerSites. The app does not patch Service externalIPs: operators must keep the Service routable from every advertised address. Node lists must be complete and valid; a failed discovery refresh retains the previous local advertisement.
The mesh has no fixed limit on the number of PeerSite objects or advertised sites. Catalogue transfers are paginated and bounded by the transfer-byte budget (16 MiB by default); endpoint lists remain bounded at 256 per site. An oversized catalogue reports a discovery error while its separately accepted DNS record transfer remains successful. Discovery never auto-creates a PeerSite for the receiver's own identity. Large meshes need deployment-specific memory, convergence and API-write budgets; see capacity.
Discovery carries a bounded site path vector to prevent loops. Returning routes are omitted rather than recycled as new seeds; successful omission retracts that advertiser’s former path. Persistent status retains both source addresses and paths, and export chooses one shortest deterministic route with its corresponding addresses. An empty learned object is retained but not advertised as a local seed. Paths track routing provenance; they are not a cryptographic trust chain.
Bootstrap addresses remain in spec. Discovery owns status and provenance, not GitOps-owned spec. Before a direct self-advertisement, indirect endpoints combine with bootstrap addresses. After direct contact, that site's own advertised list wins, including removals/empty lists, and indirect peers cannot restore removed addresses. A complete successful topology removes omitted contributions from that advertiser; an outage retains the previous metadata. If every discovered endpoint becomes obsolete, edit the PeerSite's ordered bootstrap addresses to reachable replacements. That explicit edit re-enables those seeds until a successful direct advertisement consumes the new configuration. Ordinary polling does not restore unchanged retired seeds. Legacy status without an observed bootstrap marker retries configured seeds until direct discovery establishes that marker. Ordering watermarks in status prevent a lagging replica's catalogue from replacing current endpoints, and survive receiver restart. Discovered PeerSites are retained, not automatically deleted merely because one advertiser omits them. The resource reference details precedence and status fields.
A local-ID PeerSite or signed endpoint reporting the local identity is quarantined: effective addresses become empty, status records self detection and peering stops. Failed quarantine status writes retry while the peer remains disabled in memory; the persistence error stays visible until a successful retry. Discovery never automatically clears that quarantine. Correct/remove the mistaken resource deliberately; do not treat a matching ID as a second site.
Ordered failover and transfer state
A new site begins at the first effective endpoint. Success remains sticky; on failure
the worker advances sequentially and wraps. Each record endpoint receives its own
PEER_TIMEOUT (default 3s). After a record success, topology gets a separate network
deadline; local metadata persistence has a separate 30-second internal budget. Failed
passes retain old DNS records and retry at PEER_INTERVAL (default 30s) or a coalesced
trigger. There is no exponential backoff or jitter. All pages of each transfer stay on
one TCP connection and immutable payload token, preserving a Service backend's journal.
Pagination, deltas, watermarks and bounded caches are specified in the
protocol.
Re-transfer queues a full fetch on one responding pod. Current serving data and accepted rollback watermarks remain. It cannot bypass stale-source checks. Re-transfer all sends separate API requests; a Service may route them to different pods. Inspect pod IDs and transfer status, or pin one pod for diagnosis.
Deleting a PeerSite removes its imported source when configuration converges; other contributors to the same RRset remain. Self/administrative disabling stops future contact while retained records remain governed by source retention. DNS TTLs and failed transfers do not expire imported data.
Startup, restart and key rotation
Configuration, metadata and credentials persist in Kubernetes; remote DNS snapshots, watermarks and journals remain per-pod memory. Each new pod first loads valid local state and attempts each effective peer. Failed attempts do not block readiness forever. An all-pod restart can temporarily lack remote records until direct imports warm again. Readiness is not proof of peer freshness.
The local Secret defaults to tak-os-dns-tsig. The app reads existing keys rather than
replacing them, generates 32 random bytes only when initially absent, and reloads valid
UI/GitOps/ESO updates on the local reconciliation cycle. Malformed updates retain the
last valid key and expose an error; a present invalid initial Secret is not overwritten.
Keys shorter than 16 decoded bytes trigger a UI warning.
To rotate, use Rotate local key, import a new local bundle or update the Secret through automation. A valid replacement stops acceptance of the old key once each pod reloads. There is no automatic overlap period, remote distribution or remote-site mutation. Operators may intentionally rotate to leave a peer relationship. Sites holding the old key lose future transfer access, while already imported records remain until their normal source-removal/replacement policy acts; rotation is not a remote data-deletion mechanism.
Remote credential Secrets also reload. Delete a remote credential to return that site to pending; malformed replacements retain the last valid key. See security and key API.
File mode and compatibility
File mode keeps legacy configured peers plus a reloadable local/remote TSIG file. Its
remote records remain memory-only; it does not create persisted PeerSite CRs from
transitive discovery. Use Kubernetes mode for the persisted mesh lifecycle.
PEER_KEYS_FILE remains legacy startup-only outbound configuration; use the TSIG file
for managed/reloaded keys. See configuration.
Wire v4 requires compatible peers. v1/v2/v3 are rejected, not silently downgraded. Plan upgrades together and account for cold caches on incompatible overlap. Upgrades and troubleshooting cover operational recovery.
Topology persistence/network failures appear separately as discoveryError. A valid DNS
transfer still publishes its snapshot and records success; discovery errors do not
discard it. Diagnose endpoint routes, provenance and API access without treating a
metadata failure as a DNS data deletion.
