Kubernetes Ingress - Rewrite path

12/2/2018

I’m trying to redirect the incoming connections with an ingress of a cluster created in IBM Cloud.

I’m able to successfully set up the ingress and contact the pod.

However, when the connection reaches the endpoint http://app1.myaddress.cloud/test1 is not rewrited to the right pod url ( The path still contains the /test1 and I want to remove that part).

Do you have any idea how to solve the issue?

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hello-world-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - app1.myaddress.cloud
    secretName: myclustername
  rules:
  - host: app1.myaddress.cloud
    http:
      paths:
      - path: /test
        backend:
          serviceName: hello-world-service-1
          servicePort: 30001
-- Leonardo Carraro
ibm-cloud
ibm-cloud-kubernetes
iks
kubernetes
kubernetes-ingress

1 Answer

12/2/2018
-- Leonardo Carraro
Source: StackOverflow