简体   繁体   中英

Path Based routing using ALB ingress controller

I am using ALB ingress controller for my 10 microservices.

But Path based routing is not working . Everytime ingress is creating a new load balancer for each service.

My requirement is to have a single load balancer and then use path based routing to browse to different services.

Please let me know what annotations I am missing and how to achieve this?

Example ingress is attached here which I'm currently using:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: abcd
  namespace: "default"
  annotations:
     kubernetes.io/ingress.class: "alb"
     alb.ingress.kubernetes.io/certificate-arn: arn:aws:acmxxxxx
     alb.ingress.kubernetes.io/listen-ports:
     alb.ingress.kubernetes.io/scheme: internal
     alb.ingress.kubernetes.io/subnets: subnet-1,subnet-2
     alb.ingress.kubernetes.io/security-groups: sg-1
spec:
  rules:
    - host:    abcd.com
      http:
        paths:
          - path: /def
            backend:
              serviceName: abcd
              servicePort: 80

According to https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/298 it is not likely to be feasible

the only workable solution is ingress merge

there is sample code in aws blog

I haved use them and it works, through sometimes ingress-merge created additional alb, but you could delete it manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM