I'm trying to find a solution for the problem that seems like something very common.
This works for exposing one service on 8088 port:
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myingress
namespace: myns
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/healthcheck-path: /ping
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 8088}]'
spec:
rules:
- host: myhost
http:
paths:
- path: /*
backend:
serviceName: firstservice
servicePort: 8088
How can the same thing be achieved for both services using ONE ingress?
Thanks in advance.
Eventually, to solve this problem, I've used ALB ingress controller group feature, which is currently in alpha state: https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/914
This is how my ingress resource looks now:
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myingress_1
namespace: myns
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/group.name: mygroup
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 8088}]'
spec:
rules:
- host: <HOST>
http:
paths:
- path: /*
backend:
serviceName: myservice
servicePort: 8088
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myingress_2
namespace: myns
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/group.name: mygroup
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 60004}]'
spec:
rules:
- host: <HOST>
http:
paths:
- path: /*
backend:
serviceName: myservice
servicePort: 60004
where key thing is
alb.ingress.kubernetes.io/group.name: mygroup
which connects these two ingress resources.
Therefore, I end up with following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With