Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenShift route generated targetPort doesn't use the service "targetPort" #2847

Closed
luigidemasi opened this issue Mar 22, 2024 · 1 comment · Fixed by #2850
Closed

OpenShift route generated targetPort doesn't use the service "targetPort" #2847

luigidemasi opened this issue Mar 22, 2024 · 1 comment · Fixed by #2850
Assignees
Labels
bug Something isn't working
Milestone

Comments

@luigidemasi
Copy link
Contributor

Describe the bug

the generated route's target port doesn't map to the target port, and if the service port is different than target port, so the pod is not accessible through the route.

This is due to #1460

For example a fragment like this:

metadata:
  annotations:
    api.service.kubernetes.io/path: /services/helloservice/sayHello/
spec:
  ports:
    - port: 80
      targetPort: 8080

generate a route like this:

apiVersion: route.openshift.io/v1
kind: Route
metadata:

  name: xxxxx
  namespace: xxxxxx
  
spec:
  host: xxxxxxx
  port:
    targetPort: 80
  to:
    kind: Service
    name: xxxxxx
    weight: 100
  wildcardPolicy: None

Eclipse JKube version

1.16.1

Component

OpenShift Maven Plugin

Apache Maven version

3.8.5

Gradle version

None

Steps to reproduce

create a service fragment with port different than targetPort

Expected behavior

the generated route in spec.port.targetPort should contains the service targetPort

Runtime

OpenShift

Kubernetes API Server version

1.25.3

Environment

Linux

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@luigidemasi luigidemasi added the bug Something isn't working label Mar 22, 2024
luigidemasi added a commit to luigidemasi/jkube that referenced this issue Mar 25, 2024
luigidemasi added a commit to luigidemasi/jkube that referenced this issue Mar 25, 2024
luigidemasi added a commit to luigidemasi/jkube that referenced this issue Mar 25, 2024
@manusa manusa added this to the 1.17.0 milestone Mar 26, 2024
luigidemasi added a commit to luigidemasi/jkube that referenced this issue Mar 26, 2024
@manusa
Copy link
Member

manusa commented Mar 27, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants