OCP-Route: sub path route doesn't work as expected

Bug #1781828 reported by Yossi Boaron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-kubernetes
Fix Released
Critical
Yossi Boaron

Bug Description

How to reproduce?

1. Create service named 'kuryr-demo' as follows:

 oc run --image=celebdor/kuryr-demo kuryr-demo
 oc scale dc/kuryr-demo --replicas=2
 oc expose dc/kuryr-demo --port 80 --target-port 8080

2. Create OCP-Route that will point www.example.com/test to service kuryr-demo
2.1 Create yaml file for the path route:

$ cat >> route_path.yaml << EOF
apiVersion: v1
kind: Route
metadata:
  name: route-unsecured
spec:
  host: www.example.com
  path: "/test"
  to:
    kind: Service
    name: kuryr-demo
EOF

2.2 create the route
$ oc create -f route_path.yaml

3. Hack etc/hosts to resolve www.example.com to L7 router floating IP

3.1 Get L7 router FIP

$ openstack loadbalancer show kuryr-l7-router | awk '/vip_address/ {print $4}'
10.0.0.163
$ openstack floating ip list | grep 10.0.0.163 | awk ' {print $4}'
172.24.4.7

3.2 Add resolve line to /etc/hosts file
$echo "172.24.4.7 www.example.com" >> /etc/hosts

4. Run the test

4.1 Curl the exact path - works OK
$ curl www.example.com/test
kuryr-demo-1-zqpn8: HELLO, I AM ALIVE!!!

4.2 Curl subpath

$curl www.example.com/test/test1

Actual results:

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

Expected results:
Curl succeded.

Changed in kuryr-kubernetes:
assignee: nobody → Yossi Boaron (yossi-boaron-1234)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kuryr-kubernetes (master)

Fix proposed to branch: master
Review: https://review.openstack.org/582810

Changed in kuryr-kubernetes:
status: New → In Progress
Changed in kuryr-kubernetes:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kuryr-kubernetes (master)

Reviewed: https://review.openstack.org/582810
Committed: https://git.openstack.org/cgit/openstack/kuryr-kubernetes/commit/?id=b8f5e257486b42ec156dd4fb0470a2414ee82f8a
Submitter: Zuul
Branch: master

commit b8f5e257486b42ec156dd4fb0470a2414ee82f8a
Author: Yossi Boaron <email address hidden>
Date: Mon Jul 16 00:26:57 2018 +0300

    OCP-Router: Fix path route to support subpath

    OCP-Route supports path based routes, path based routes specify a path
    component that can be compared against a URL such that multiple routes
    can be served using the same host name, each with a different path.

    Assuming that OCP-Route object that maps hostname:'www.test.com',
    path:'/path', to service named: 'target_service' was created.
    We should expect that all URL starts with 'www.test.com/path' should
    be routed to 'target_service' pods.

    This patch updates ocp-route handler to support the above requirement.

    Change-Id: I95df37663fc7016f81ebf7b9683779e023b6d24c
    Closes-Bug: 1781828

Changed in kuryr-kubernetes:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kuryr-kubernetes 0.5.0

This issue was fixed in the openstack/kuryr-kubernetes 0.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.