cancel
Showing results for 
Search instead for 
Did you mean: 
  • 1,428 Views

DO280 - creating route : different behavior between Web Console and command line

Hello all,

I am studying DO280.

In guided exercise Chapter 5 "Exposing Applications for External Access", point 2.3. says to give:

$ oc expose svc todo-http --hostname todo-http.apps.ocp4.example.com

to create a normal route to the service defined this way:
- listeing port: 80
- target port : 8080

The above command shows a correct behavior and I am not complaining this command.


Doing the very same thing from Web Console using the available "Create Route" action I am able to create the same route as oc does, but for it target port 80 instead of 8080.

Comparing the two yaml (the one produced by oc and the one produced by WebConsole) I found that the target port number is the only difference between the two yaml.

And, as far as I can see, there is no way from within the Web Console to choose a different the right 8080 port: the only way is editing the Yaml after creation.

IMO this is at least a misleading behavior of WebConsole, if not a genuine bug.

Can anyone replicate my case and/or explain the Web Console behavior ?

Regard.

__ Matteo.

 

Labels (3)
0 Kudos
2 Replies
jordisola
Flight Engineer
Flight Engineer
  • 1,363 Views

Hi Matteo

Maybe the confusion comes from the nomenclature here.

What you actually see in the route is not the port of the service, but the name of the service.

For example, with a default service/route you see something like this:

Ports1.png

That's because the port is nameless. Nameless port are referenced by the targetPort.

Instead, if you give a name to the port:

Ports2.pngthen you can see the port in the route is referenced by name.

So, summarizing, you see 8080 not as the target port for the route, but as the name of the (nameless) port for the route.


Hope that helps!

Jordi Sola

0 Kudos
  • 1,328 Views

Hi Jordi,

thank you for your reply. 

Here is the command sequence that replicates the case

oc expose svc todo-http --hostname todo-http.apps.ocp4.example.com
oc get route todo/http -o yaml > todo-http-LOC.yaml
oc delete route todo-http
# create route from Web Console (see snippet below)
oc get route todo/http -o yaml > todo-http-WEB.yaml
diff todo-http-LOC.yaml todo-http-WEB.yaml | grep targetPort

< targetPort: 8080
> targetPort: 80

In the first snippet, the "Target-Port" combo-box allows you to choose only "80 --> 8080" i.e. what the service is defined.

The second snippet shows the same unexpected targetPort 80 already shown from the diff command above.

Regards.

_Matteo.

Cattura1.PNGCattura2.PNG

0 Kudos
Join the discussion
You must log in to join this conversation.