How to achieve host and path based routing from AWS Application Load Balancers with virtual hosts?

4/21/2021

Background

I have 6 services app1, app2.. in a AWS EKS. They have their own ingresses with following hosts (like virtual hosts).

  • app1.mylocaldomain.io
  • app2.mylocaldomain.io
  • ..

(Their ingresses were baked into their Helm Charts)

There is also load balancer which both ingress use: alb-dns-name-kubernetes.com (Created from nginx-ingress)

That means, When I can do curl with proper header, I get success response:

curl -H "Host: app1.mylocaldomain.io" alb-dns-name-kubernetes.com

Desired behavior

I want to achieve path and host based routing with another extra Loadbalancer. (Which I will point to app.domain.io from Route53).If my New load balancer is alb-dns-name-extra.com, I want to achieve mix of path and host based routing with my new domain app.domain.io like below:

  • app.domain.io/app1 --> app1.mylocaldomain.io
  • app.domain.io/app2 --> app2.mylocaldomain.io ...

Is there a way I can achieve this.

Restrictions

  • Without creating extra ingress-resource in kubernetes.
  • *.mylocaldomain.io, they are local host names, so simple redirect will not work.

Thanks

-- yogen48
amazon-cloudfront
amazon-web-services
aws-application-load-balancer
kubernetes
nginx-ingress

0 Answers