How to enable request URI override using kubernetes ingress #10213
Unanswered
rolf-schurink
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I am having challenges with configuring path routing via the kubernetes ingress setup
Here is my yml file:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-router2
spec:
ingressClassName: apisix
rules:
- host: myhostname
http:
paths:
- backend:
service:
name: microbot
port:
number: 80
path: /v1
pathType: Exact
- backend:
service:
name: microbot2
port:
number: 80
path: /v2
pathType: Exact
Applying this with kubectl apply -f creates the routes successfully, but it routes the request to the pod without rewriting the "/v1" to "/" and then fails with a 404 (as expected). Therafter when going to the apisix dashboard and manually enabling "Request Override" and URI Override = Static entering "/" my route works 100%.
I tried various ways to achieve this setup via the xml file without success. Also tried using a plugin like so:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-router2
annotations:
apisix.apache.org/plugins: |
proxy-rewrite:
uri: "/"
...
Please can someone point me in the right direction how to achieve the uri override for my route via ingress?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions