Hi,
I installed kong kubernetes ingress controller. I created an ingress resource for my application.
apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: baster-api-ingress namespace: baster annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1 kubernetes.io/ingress.class: kong spec: rules: - http: paths: - path: /(.*) backend: serviceName: baster-api servicePort: 5000
apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: mongo-express-ingress namespace: baster annotations: kubernetes.io/ingress.class: kong spec: rules: - http: paths: - path: /mongo-express backend: serviceName: mongo-express servicePort: 8081
Before using Kong i was using nginx ingress as k8s ingress controller and used it for sending the URI paths to the upstream using rewrite-target plugin (Rewrite - Ingress-Nginx Controller).
When i access http://hostname/path1, http://hostname/path2 then it sends to baster-api service with uri path /path1 and /path2 respectively…
But, If i send http://hostname/mongo-express it sends to mongo-express service with /mongo-express uri to this upstream
It was working fine and was routing the ingress to right service based on the uri and sends the uri to the target services.
Now i started using Kong and used the same nginx rewrite plugin to send the uri to right upstream. But now it is always sending to baster-api even if i try to access with /mongo-express.
How to fix this ? is there any native way in kong to send the URI paths to the upstream services based on match ? or can i make the nginx annotation work in someway ?