Remove routing path from Kubernetes ingress

10/22/2018

I deployed service called "test" in kubernetes. service name : test port : 80

There is endpoint called "/abc"

ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: load-balancer

spec:
  rules:
  - http:
      paths:
      - path: /test/*
        backend:
          serviceName: test
          servicePort: 80

API call "http://ip-address/test/abc" given 404 error. But endpoint "/test/abc" working properly.

I need skip "/test" when routing. How I do this.

-- Nuwan Sameera
google-kubernetes-engine

1 Answer

10/25/2018

You're looking for url rewriting feature. It's currently only supported on nginx-ingress (not GKE ingress). https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md.

But you can install nginx-ingress controller on GKE if you want, there's documentation on how to do that.

-- AhmetB - Google
Source: StackOverflow