feat(nomad): support HA mode with multiple servers#191
Open
aleksclark wants to merge 1 commit into
Open
Conversation
Add sticky failover across multiple Nomad server addresses so the integration keeps working when the leader or an individual server is unreachable. Accepts a new addresses credential (comma/newline list, NOMAD_ADDRS) alongside the existing address; requests fail over on transport errors and retryable 5xx/429 while definitive 4xx responses return immediately. Co-Authored-By: Claude Opus <noreply@anthropic.com>
acmacalister
approved these changes
Jun 22, 2026
acmacalister
left a comment
Collaborator
There was a problem hiding this comment.
CI/status checks are passing. Clean PR — no blocking issues found. LGTM.
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.
Summary
addressescredential (comma- or newline-separated, envNOMAD_ADDRS) alongside the existingaddress; values are parsed, trailing-slash-trimmed, deduplicated, and order-preserved. Fully backward compatible — singleaddress/NOMAD_ADDRbehaves exactly as before.preferredserver index advances stickily so a downed server isn't retried on every call.Details
integrations/nomad/nomad.go:nomadstruct now holdsaddresses []string+preferred atomic.Uint32; splitdoRequestinto a failover loop overdoRequestTo; addedparseAddresses,apiError,shouldFailover, plusPlaceholders()/OptionalKeys()for web-UI guidance.config/config.go: addedaddressesdefault credential andaddresses → NOMAD_ADDRSenv mapping.Test plan
go build ./...go test -race ./...go vet ./...go tool golangci-lint run(0 issues)go tool gosec(clean)parseAddresses, multi-addressConfigure, failover on server-down / 5xx, exhaustion → retryable, no-failover on 4xx, sticky preference, body replay, placeholder/optional-key hintsmake deploy— built and restarted local daemon successfully💘 Generated with Crush