I'd like to define in Openshift one route with multiple paths, each path forwarding to a different service. For example /pathA would forward requests to ServiceA , whilst /pathB would forward requests to ServiceB.
Is this possible in OpenShift? If not, what would be the recommended approach?
I have also read about route sharding, however I cannot say that I've grasped the concept clearly.
Thanks.
You need to create multiple routes per each path. But it can add multiple paths to same hostname. It's a same result of one route with multiple path you said. Refer Path Based Routes for more details.
For ServiceA
,
apiVersion: v1
kind: Route
metadata:
name: route-path-a
spec:
host: www.example.com
path: "/patha"
to:
kind: Service
name: service-a
For ServiceB
,
apiVersion: v1
kind: Route
metadata:
name: route-path-b
spec:
host: www.example.com
path: "/pathb"
to:
kind: Service
name: service-b