Add consul mesh gateways and enable gateway WAN federation #549

Closed
unkin-agent wants to merge 5 commits from benvin/consul-mesh-gateway into benvin/consul-server-tls-fed
Member

Federating the datacenters through mesh gateways needs an envoy gateway on each consul server, and the WAN federation flag must ship with the gateways. Requires rpmbuilder #187 (envoy RPM).

  • add profiles::consul::mesh_gateway running consul connect envoy -gateway=mesh -expose-servers as a systemd unit with its own ACL token file
  • gate the gateway on Class['consul'], which servers only declare once /data is mounted
  • include the gateway in the consul server role
  • enable enable_mesh_gateway_wan_federation on consul servers
Federating the datacenters through mesh gateways needs an envoy gateway on each consul server, and the WAN federation flag must ship with the gateways. Requires rpmbuilder #187 (envoy RPM). - add profiles::consul::mesh_gateway running `consul connect envoy -gateway=mesh -expose-servers` as a systemd unit with its own ACL token file - gate the gateway on Class['consul'], which servers only declare once /data is mounted - include the gateway in the consul server role - enable `enable_mesh_gateway_wan_federation` on consul servers
unkin-agent added 1 commit 2026-10-07 11:54:35 +11:00
Add consul mesh gateway on consul servers
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
3e90f5907c
Author
Member
  • hieradata/roles/infra/storage/consul.yaml:61 — mesh-gateway token policy lacks mesh = "write", which Consul requires for the gateway leaf cert. puppet-consul 9.1.0 consul_policy cannot encode a top-level mesh rule (only acl/operator/keyring), so it cannot be added to node_rules → give the gateway its own token whose policy includes mesh = "write", managed outside consul_policy rules, or extend the encoder.
- hieradata/roles/infra/storage/consul.yaml:61 — mesh-gateway token policy lacks `mesh = "write"`, which Consul requires for the gateway leaf cert. puppet-consul 9.1.0 `consul_policy` cannot encode a top-level `mesh` rule (only acl/operator/keyring), so it cannot be added to node_rules → give the gateway its own token whose policy includes `mesh = "write"`, managed outside `consul_policy` rules, or extend the encoder.
unkin-agent added 1 commit 2026-10-07 11:58:38 +11:00
Merge remote-tracking branch 'origin/benvin/consul-server-tls-fed' into benvin/consul-mesh-gateway
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
2651449d57
Author
Member
  • nit: site/profiles/manifests/consul/mesh_gateway.pp:45 — unit/token file have no ordering on Class['consul'] (consul binary, consul.service, consul user); on a fresh server where server.pp skips Class['consul'] (no /data mount yet) the first run fails on owner=>consul and Requires=consul.service → require Class['consul'] or gate the profile on defined(Class['consul']) like server.pp does
- nit: site/profiles/manifests/consul/mesh_gateway.pp:45 — unit/token file have no ordering on Class['consul'] (consul binary, consul.service, consul user); on a fresh server where server.pp skips Class['consul'] (no /data mount yet) the first run fails on owner=>consul and Requires=consul.service → require Class['consul'] or gate the profile on defined(Class['consul']) like server.pp does
unkin-agent added 3 commits 2026-10-09 19:32:01 +11:00
Gate mesh gateway resources on the consul class
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
f6a429bdf1
unkin-agent changed title from Add consul mesh gateway on consul servers to Add consul mesh gateways and enable gateway WAN federation 2026-10-09 19:32:07 +11:00
Author
Member
  • site/profiles/manifests/consul/server.pp:135 — enable_mesh_gateway_wan_federation with node_name = fqdn breaks WAN gossip: wanfed SplitNodeName rejects any WAN name not exactly <node>.<dc> (consul v1.22.7 agent/consul/wanfed/wanfed.go:160-166), so every WAN dial/write fails and servers never WAN-join each other or a remote DC → move servers to a dotless node_name (hostname) and matching <hostname>.server.<dc>.consul SANs in an earlier PR of the stack before enabling this flag
  • nit: hieradata/roles/infra/storage/consul.yaml:61 — node policy grants (mesh-gateway write, service_prefix/node_prefix/agent_prefix read) are not in the PR body → add them to the change list
- site/profiles/manifests/consul/server.pp:135 — `enable_mesh_gateway_wan_federation` with `node_name` = fqdn breaks WAN gossip: wanfed `SplitNodeName` rejects any WAN name not exactly `<node>.<dc>` (consul v1.22.7 agent/consul/wanfed/wanfed.go:160-166), so every WAN dial/write fails and servers never WAN-join each other or a remote DC → move servers to a dotless `node_name` (hostname) and matching `<hostname>.server.<dc>.consul` SANs in an earlier PR of the stack before enabling this flag - nit: hieradata/roles/infra/storage/consul.yaml:61 — node policy grants (`mesh-gateway` write, `service_prefix`/`node_prefix`/`agent_prefix` read) are not in the PR body → add them to the change list
unkin-agent closed this pull request 2026-10-09 22:18:27 +11:00
Some checks are pending
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful

Pull request closed

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/puppet-prod#549