Kubernetes Ingress - Rewrite path

7.5k views Asked by At

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
1

There are 1 answers

2
Leonardo Carraro On BEST ANSWER