Openshift Multiple routers for an application

4/24/2019

We want to spinup 5 pods for an application deployed in Openshift cluster. We want to configure 2 routes for the same application.

For e.g. Pod1, Pod2 & Pod3 can be reached using route1
         Pod4 & Pod5 can be reached using route2..

Is it possible to configure two different routes for multiple pods

-- user3811946
kubernetes
openshift

2 Answers

4/25/2019

Is this DeploymentConfig consist of 5 replicas. Then it is not possible to create separate routes for different pods. You have to create separate DeploymentConfigs to be able to create separate routes for different pods.

-- Vasily Angapov
Source: StackOverflow

4/25/2019

yes, it is possible but you need to do little hack.

  1. Deploy 5 pods.
  2. create two services and one route for each service
  3. service one uses selector say, 'mypod:123' and second service selects pod with label 'mypod:45'
  4. Patch unique label say 'mypod:123' to pod1, pod2, pod3
  5. Patch label 'mypod:45' to pod 4 and 5

It is not a recommended approach but it should work.

the limitation of this approach is that if a pod gets terminated a new one gets spinned up, you need to manually patch the pod with correct label.

to avoid manual intervention , suggest you to go with two separate deployments

-- P Ekambaram
Source: StackOverflow