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?
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.
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.
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.
Ok, it seems not supported at this time => https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/835
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