V
V
Venot2021-12-07 19:41:42
Openshift
Venot, 2021-12-07 19:41:42

Which port does OpenShift's route refer to in the targetPort field, a service port or a container port?

For example, there is a route that refers to 9081 targetPort,
then if this is the case in the service, it will transfer the container port to 8080:

- name: http-8081
      protocol: TCP
      port: 9081
      targetPort: 8080
    - name: http-8080
      protocol: TCP
      port: 9080
      targetPort: 7081

but if you add another target port, then it will send to container port 9081:
- name: http-8081
      protocol: TCP
      port: 9081
      targetPort: 8080
    - name: http-8080
      protocol: TCP
      port: 9080
      targetPort: 8081
    - name: https-8443
      protocol: TCP
      port: 9443
      targetPort: 9081

and now the question arose, does it look for a match in the targetPort service at the beginning, if not found, then already by the service port and redirect to the service targetPort?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question