Thanks David for the example. I tried it, with this we can only redirect 
/test/data to /data, but we won't be able to redirect /test to /.

We actually want /test to remain redirected to / itself and /test/data to 
redirect to /data and /test/data/runs to /data/runs and so on.

So in short, we just want /test/* to be redirected to /*.

Is there any provision for such wildcard match kind of thing?

Thanks much,
Kanthi


On Saturday, April 28, 2018 at 2:08:14 AM UTC+5:30, David Rosenstrauch 
wrote:
>
> If you were using the nginx ingress, you would do it like this: 
>
> apiVersion: extensions/v1beta1 
> kind: Ingress 
> metadata: 
>    name: test-ingress 
>    annotations: 
>      nginx.ingress.kubernetes.io/rewrite-target: /data 
>      nginx.ingress.kubernetes.io/ssl-redirect: "false" 
> spec: 
>    rules: 
>    - http: 
>        paths: 
>        - path: /test/data 
>          backend: 
>            serviceName: test 
>            servicePort: 6006 
>
> (See: 
>
> https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/rewrite)
>  
>
>
> But I'm not sure how you'd do it using traefik.  (And I don't think the 
> standard k8s ingress controller supports rewrite.) 
>
> HTH, 
>
> DR 
>
> On 04/27/2018 03:11 PM, Kanthi P wrote: 
> > Hi, Need some help with ingress controller 
> > we want to redirect a http request say <host>/<path>/xyz to be mapped to 
> a 
> > service in the backend. And the service should receive the request as 
> > <host>/xyz 
> > How do we annotate this in the ingress resource? 
> > 
> > Have configured the ingress resource as shown: 
> > 
> > 
> > apiVersion: extensions/v1beta1 
> > kind: Ingress 
> > metadata: 
> >   annotations: 
> >     kubernetes.io/ingress.class: traefik 
> >   name: test-ingress 
> >   namespace: default 
> >   
> > spec: 
> >   rules: 
> >   - http: 
> >       paths: 
> >       - backend: 
> >           serviceName: test 
> >           servicePort: 6006 
> >         path: /test 
> > status: 
> >   loadBalancer: {} 
> > 
> > But the problem is <host>/test/data gets redirected as <host>/, but we 
> want 
> > it to be redirected as <host>/data 
> > Any idea how to annotate this? 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to