vmagent: set consul datacenter (fix 0 discovered targets) #240

Merged
benvin merged 1 commits from benvin/vmagent-consul-datacenter into main 2026-07-07 00:05:31 +10:00
Owner

Why

The Consul SD job discovered 0 targets. vmagent logs showed it reaching the puppet Consul fine (TLS/connectivity OK) but getting 403 on GET /v1/agent/self: the anonymous token lacks permission 'agent:read'. VictoriaMetrics calls /v1/agent/self only to auto-detect the datacenter; catalog/health reads (what SD actually needs) work anonymously.

Fix

Set datacenter: au-syd1 on the consul_sd_config so VM skips the agent/self call. No consul token needed.

Verify after sync

vmagent /targetsconsul job shows the puppet targets (haproxy/ceph/gitea/node/…) up.

## Why The Consul SD job discovered **0 targets**. vmagent logs showed it reaching the puppet Consul fine (TLS/connectivity OK) but getting `403` on `GET /v1/agent/self`: the anonymous token `lacks permission 'agent:read'`. VictoriaMetrics calls `/v1/agent/self` only to auto-detect the datacenter; catalog/health reads (what SD actually needs) work anonymously. ## Fix Set `datacenter: au-syd1` on the consul_sd_config so VM skips the `agent/self` call. No consul token needed. ## Verify after sync vmagent `/targets` → `consul` job shows the puppet targets (haproxy/ceph/gitea/node/…) up.
unkinben added 1 commit 2026-07-06 23:57:53 +10:00
vmagent: set consul datacenter to avoid agent:read requirement
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful
4f3c81a303
The consul SD discovered 0 targets: VictoriaMetrics queried
/v1/agent/self to auto-detect the datacenter, which needs agent:read that
the anonymous consul token lacks (catalog/health reads work anonymously).
Set datacenter: au-syd1 explicitly so the agent/self call is skipped.
benvin merged commit 55e41897ef into main 2026-07-07 00:05:31 +10:00
benvin deleted branch benvin/vmagent-consul-datacenter 2026-07-07 00:05:31 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/argocd-apps#240