'Openshift routes are not redirected to particular service

I have deployed few services of my application on openshift : E.g., app-ui, app-backend,app-store ,main. I have defined separate routes for these services to access externally.

  1. app-ui -- ui.test-dev.***.net
  2. app-backend -- backend.test-dev.***.net
  3. app-store-- store.test-dev.***.net
  4. Main -- test-dev.***.net I have defined these DNS using host property in route in openshift yaml file.

The issue is when I m trying to access app-ui, i am getting the response from app-backend,similarly when I am checking app-store or main app , i am getting random response from any of these services. I m not sure why it's not able to redirect to correct service based on the route .Can anyone please help me on this ??



Solution 1:[1]

Validate the following in the route

  1. Path
  2. Service "should be the one of the app you are directing to"
  3. Target port "that it's going to the port of the app you want to expose"

How to check above?

oc describe route <route name>

In the output, check all above ones to troubleshoot.

Good luck

Solution 2:[2]

I think you have to validate Route as well as service to check whether it is pointing to the right one with a selector pod or not.

for this you can run the following commands:

oc get routes <route-name>
oc describe  routes <route-name>
oc describe service <service-name>

example: * This consist resource names that i used in openshift env. so don;t get confuse.

Step 1:

oc get routes <route-name>

route-command

Step 2:

oc describe routes dev-route

enter image description here

here you can validate Service and Endpoint values

Step 3:

oc describe service farnodes-web-svc

enter image description here

here you can validate Selector, Type, Port & TargetPort

In the output, Follow all above steps to troubleshoot. Post back over here.

Good luck!!!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sam
Solution 2 swetank soni