Created attachment 1755089 [details] Creating a route that targets one port in the user interface Description of problem: I am trying to create an OpenShift route to a Kubernetes service with multiple ports. I only want to route to one port of the service. Version-Release number of selected component (if applicable): Steps to Reproduce: 1. Create a service with multiple ports, e.g. https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services 2. Create a route to one port of the service (see attachment), or run ```oc expose svc <service-name> --port <port>``` Actual results: ```oc describe route <route-name>``` > Output ``` ... Endpoint Port: server Service: <example-service> Weight: 100 (100%) Endpoints: 10.129.2.38:8084, 10.129.2.38:8081 ``` Expected results: ``` ... Endpoint Port: server Service: <example-service> Weight: 100 (100%) Endpoints: 10.129.2.38:8081 ```
This is a reproducible issue with `oc describe route`. Note that `oc expose svc <service-name> --port <port>` appears to be working as intended. `oc describe route` is simply divulging more endpoints than it should be, since the router only serves endpoints that correspond to spec.Port.
verified correct endpoint is displayed in "oc describe route" with oc48 client after creating a route to one specified port in a multi-port service [jechen@jechen bin]$ oc version Client Version: 4.8.0-0.nightly-2021-02-23-200827 Server Version: 4.8.0-0.nightly-2021-02-24-063313 Kubernetes Version: v1.20.0+6f8878d (steps omitted here) created web server pod and svc with two ports first [jechen@jechen test2]$ oc get ep NAME ENDPOINTS AGE web-server 10.129.2.61:8443,10.129.2.61:8080 15s [jechen@jechen test2]$ oc expose svc web-server –port=8080 [jechen@jechen bin]$ oc describe route Name: web-server Namespace: test Created: About an hour ago Labels: name=web-server Annotations: openshift.io/host.generated=true Requested Host: web-server-test.apps.jechen-oc48-0223b.qe.devcluster.openshift.com exposed on router default (host apps.jechen-oc48-0223b.qe.devcluster.openshift.com) about an hour ago Path: <none> TLS Termination: <none> Insecure Policy: <none> Endpoint Port: 8080 Service: web-server Weight: 100 (100%) Endpoints: 10.129.2.61:8080
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2438