Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rewrite target url within an AWS ALB Ingress Controller?

In a classic Kubernetes Nginx ingress I know that it is possible to rewrite target url based on a specific regex by appling this annotation nginx.ingress.kubernetes.io/rewrite-target: /$1

But this annotation does not work in AWS ALB ingress. Does anyone know if it is possible to do rewriting work with this kind of ingress?

like image 989
Martin Tovmassian Avatar asked Apr 19 '19 15:04

Martin Tovmassian


People also ask

How does ALB work in ingress?

The open source AWS ALB Ingress controller triggers the creation of an ALB and the necessary supporting AWS resources whenever a Kubernetes user declares an Ingress resource in the cluster. The Ingress resource uses the ALB to route HTTP(S) traffic to different endpoints within the cluster.

What ALB ingress kubernetes IO target type?

alb.ingress.kubernetes.io/target-type specifies how to route traffic to pods. You can choose between instance and ip : instance mode will route traffic to all ec2 instances within cluster on NodePort opened for your service. ip mode will route traffic directly to the pod IP.

How do I block a URL in ingress?

You cannot block specific paths. What you can do is point the path of the host inside your ingress to a default backedn application that says 404 default backedn for example. Save this answer.


1 Answers

Ok, it seems not supported at this time => https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/835

like image 69
Martin Tovmassian Avatar answered Sep 28 '22 07:09

Martin Tovmassian