<p>I have 2 questions:</p>

<p>1) I have a kubernetes cluster with multiple services and I want to use ingress to dynamically redirect the traffic to the cluster.</p>

<p>I expect the configuration to look something like this:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /service1/*
        backend:
          serviceName: service1
          servicePort: 80
        path: /*
      - path: /service2/*
        backend:
          serviceName: service2
          servicePort: 80
        path:/*
</code></pre>

<p>So basically I want all the traffic to /service1/endpoint to be redirected to s1:80/endpoint dynamically.</p>

<p>2) Let's say I have 2 web services - service1 &amp; service2.</p>

<p>I want the users to work with the following URL in their browser:</p>

<p>kube/serviceN/endpoint</p>

<p>Is there a way to do that without having my users redirected to service1/endpoint?</p>

<p>Thanks!</p>

RamenCoder
<p>I believe your ingress definition to be almost correct:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /service1
        backend:
          serviceName: service1
          servicePort: 80
      - path: /service2
        backend:
          serviceName: service2
          servicePort: 80
</code></pre>

<p>This should work if you have an ingress correctly deployed!</p>
