Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cluster Peering with Consul Template #1810

Closed
Esity opened this issue Sep 18, 2023 · 1 comment · Fixed by #1869, #1822 or #1842
Closed

Support Cluster Peering with Consul Template #1810

Esity opened this issue Sep 18, 2023 · 1 comment · Fixed by #1869, #1822 or #1842

Comments

@Esity
Copy link

Esity commented Sep 18, 2023

Currently, Consul Template supports querying across federation links to other datacenters but has no docs and appears to not support querying services from peering connections which seems silly

### `datacenters`
Query [Consul][consul] for all datacenters in its catalog.
```golang
{{ datacenters }}
```
For example:
```golang
{{ range datacenters }}
{{ . }}{{ end }}
```
renders
```text
dc1
dc2
```
An optional boolean can be specified which instructs Consul Template to ignore
datacenters which are inaccessible or do not have a current leader. Enabling
this option requires an O(N+1) operation and therefore is not recommended in
environments where performance is a factor.
```golang
// Ignores datacenters which are inaccessible
{{ datacenters true }}
```

I don't see a good reason on why we wouldn't add this in as a supported thing considering federation is going away
Example PR talking about querying consul via DNS for peering
https://github.com/hashicorp/consul/blob/3332f63c4c00592e186843df85df9a5d0241cf7b/website/content/docs/services/discovery/dns-static-lookups.mdx#L102-L110

@blake
Copy link
Member

blake commented Apr 24, 2024

@Esity Support for listing peers and querying services from peers was implemented in #1822 and #1869, and is available in the recent releases of Consul template.

@blake blake closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment