Repository navigation
Reconcile and DNS per host; wire incus_remote into migrate (#85) - #97
Merged
Merged
Conversation
… the per-host loop The Reconciler takes its SSH credentials, SSH sessions, SSH wait and DNS provider from fields that tests replace. Behaviour is unchanged; the golden files in pkg/engine/testdata are main's output for a single host, so the per-host loop that follows can be checked against them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reconcile: each host of fleet.yml is reconciled on its own, in name order (provision with its daemon from cloud-init, then its Incus runtime over SSH), with its own address, SSH user/port and bridge. The single primaryHostIP, hostSSHUser and hostSSHPort are gone. With several hosts a host that fails is logged, the others carry on, and the run fails at the end naming each failed host. The fleet domain's apex and wildcard point at the default host. A single host reconciles exactly as before (golden files from the previous commit). DNS follows the host, replacing #89's "the default host's daemon owns all dns_records": a dns_records entry with `service:` belongs to that service's host (an A/AAAA one takes the host's address), a route of a service off the default host under `domain:` gets an A record at its host, and every other record is the default host's. Each daemon plans and applies only its own records and notes which host does the others. validate and the plan refuse a wildcard tied to a service, a wildcard or apex route off the default host, and any record two hosts would claim. `dns sync` writes every host's records. incus_remote: a deploy records fleet.yml's hosts and their incus_remote in the state directory (host-remotes.json); POST /v1/instances/{name}/migrate takes target_host and resolves it to that remote. fleet.yml checks incus_remote's shape and that no two hosts share one. validate lists each host's address, services and DNS records when fleet.yml has two or more hosts. Closes #85. Part of #43. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reconcile Only the docs conflicted: README's node-02 example now shows both its incus_remote and its mesh key, and the daemon.md roadmap lists the mesh, DNS and reconcile per host, host-keyed backups and the migrate job as done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged
The full check set passes (gofmt, mod tidy, vet, One full-suite run failed Drafted by William's agent (Claude). |
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.
Closes #85. Part of #43.
What changed
Reconcile per host (
pkg/engine/reconciler.go). The singleprimaryHostIP/hostSSHUser/hostSSHPortare gone. Each host is reconciled on its own, in sorted name order: it is provisioned (with its daemon from cloud-init, and--host-namewhen there are several hosts), then its Incus runtime is bootstrapped over SSH. Each host uses its own address, SSH user and port, and bridge.1 of 2 hosts failed: host alpha: ...).main's code. The second commit rewrites the loop, and the same goldens still pass: SSH, SSH plus--deploy-services, DNS failing, SSH failing, local, no address, and no hosts.DNS follows the host. This replaces #89's stopgap, where the default host's daemon wrote every DNS record.
dns_recordsentries takeservice:. Such a record belongs to that service's host (host:, elsedefault_host). An A or AAAA record tied to a service leaves outvalue:and gets the host'saddress:.domain:gets an A record at its own host's address. Without it, the wildcard would send that name to the default host.note: dns: host h2's daemon plans and applies ...).config.FleetConfig.DNSRecordsByHostholds the rules. Validation refuses, and the plan blocks on:domain:'s apex or wildcard);value:;native-ops dns syncwrites the records of every host.incus_remoteis wired in, not removed.fleet.yml's hosts and theirincus_remotein<state-dir>/host-remotes.json.POST /v1/instances/{name}/migratenow also takes{"target_host": "..."}and resolves it to that host's remote.target_hostis refused when:target_remote;incus_remote;target_remoteworks as before.fleet.ymlnow checks the shape ofincus_remote, refuseslocal, and refuses two hosts sharing one remote.validate per host. With two or more hosts,
native-ops validatelists each host's address, its services and the DNS records that point at it. A plan's per-host DNS section is the set of notes described above. Host names in validate output are now sorted.Docs:
docs/daemon.mdgets new "DNS with several hosts" and "Reconcile with several hosts" sections. The Several hosts bullets, migrate (target_host), the state directory table and the roadmap are updated. The README'sfleet.ymlreference now coversincus_remote,address, anddns_recordswithservice:.For review
domain:. External routes, routes on the default host, and routes outside the zone get no record. For a route outside the zone, declare adns_recordsentry withservice:.hosts.<name>.addressto be a literal IP.auto(DigitalOcean) is refused with a clear message, because the daemon has no other way to learn the address.DNSRecordsByHostblock the plan. They don't failPlanFleetwithbad_config. This keeps a single-host plan's existing "dns_records: no zone" blocker unchanged.reconciler.go, the Level-0 and bootstrap code moved intoprovisionHostandbootstrapHost, so a merge there should only need hunks moved into those functions.Checks (all pass)
gofmt -l .: prints nothinggo mod tidy && git diff --exit-code go.mod go.sum: cleango vet ./...: cleango test -race ./...: all packages oknode --check pkg/server/ui/static/js/app.js: okTestREADMECarriesTheUsagepasses)New tests:
incus_remotevalidation;target_hostresolution, refusals and role gate;No self-merge.
🤖 Generated with Claude Code