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

kubernetes service discovery for multi-cluster kubernetes and haproxy as GLSB #4431

Open
cervajs opened this issue Nov 23, 2024 · 0 comments
Labels
type/question Question about product, ideally should be pointed to discuss.hashicorp.com

Comments

@cervajs
Copy link

cervajs commented Nov 23, 2024

Question

i have following use case/scenario

  • One main DC (DC1) . center of star network topology
  • DC2 to DCX (i.e. 5)
  • DCs are connected on L3 layer
  • HAProxy in main DC as GSLB
  • Consul cluster on VMs in DC1
  • One or more Kubernetes clusters in every DC
  • web application i.e. webapp1 spread through multiple Kubernetes clusters(DCs) - multiAZ availability
  • consul-k8s syncCatalog in every cluster synced to central Consul cluster

example

DC1 subnet 192.168.1.0/24
DC2 subnet 192.168.2.0/24,  kubernetes cluster2 (3 worker nodes)
DC3 subnet 192.168.3.0/24,  kubernetes cluster3 (2 worker nodes)

webapp1 is running in 4 replicas

worker2 (192.168.2.21), worker3(192.168.2.22) in cluster2
worker1(192.168.3.20),worker2(192.168.3.21) in cluster3

so the question is is it possible export Kubernetes webapp1 services with their respective worker IP addresses to consul?
HAProxy can then read it from Consul and route traffic to the right backends.

i.e.

backend consul-backend-consul-webapp1
  server SRV_wUDs 192.168.2.21:80 check weight 128
  server SRV_kGr8S 192.168.2.22:80 check weight 128
  server SRV_LCD2f 192.168.3.20:80 check weight 128
  server SRV_Hiw5l 192.168.3.21:80 check weight 128
  server SRV_Wz0jE 127.0.0.1:80 disabled weight 128
  server SRV_jIkbE 127.0.0.1:80 disabled weight 128
@cervajs cervajs added the type/question Question about product, ideally should be pointed to discuss.hashicorp.com label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Question about product, ideally should be pointed to discuss.hashicorp.com
Projects
None yet
Development

No branches or pull requests

1 participant