question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression issue: Wrong port in OpenShift route

See original GitHub issue

Describe the bug

(Describe the problem clearly and concisely.)

Actual behavior

The port in the route is set to 80 and it should be 8080.

To Reproduce

Steps to reproduce the behavior:

  1. mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=org.acme -DprojectArtifactId=openshift-quickstart -DclassName="org.acme.rest.GreetingResource" -Dpath="/greeting" -Dextensions=openshift
  2. cd openshift-quickstart
  3. Deploy it using mvn package -Dquarkus.kubernetes.deploy=true -Dquarkus.openshift.expose=true

The maven command finished ok, but when trying to have access to the application, the route endpoint always gets 503 Gateway error.

The problem is that the port is set to 80 and it should be 8080.

See the whole content of the openshift.yml file:

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  ports:
  - name: http
    port: 80
    targetPort: 8080
  selector:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: ClusterIP
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  name: openjdk-11
spec:
  dockerImageRepository: registry.access.redhat.com/ubi8/openjdk-11
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec: {}
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  output:
    to:
      kind: ImageStreamTag
      name: openshift-quickstart:1.0.0-SNAPSHOT
  source:
    binary: {}
  strategy:
    sourceStrategy:
      from:
        kind: ImageStreamTag
        name: openjdk-11:latest
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  replicas: 1
  selector:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  template:
    metadata:
      annotations:
        app.openshift.io/vcs-url: <<unknown>>
        app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
      labels:
        app.kubernetes.io/name: openshift-quickstart
        app.kubernetes.io/version: 1.0.0-SNAPSHOT
        app.openshift.io/runtime: quarkus
    spec:
      containers:
      - args:
        - -Dquarkus.http.host=0.0.0.0
        - -Djava.util.logging.manager=org.jboss.logmanager.LogManager
        - -jar
        - /deployments/quarkus-run.jar
        command:
        - java
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: JAVA_APP_JAR
          value: /deployments/openshift-quickstart-1.0.0-SNAPSHOT-runner.jar
        image: jcarvaja/openshift-quickstart:1.0.0-SNAPSHOT
        imagePullPolicy: IfNotPresent
        name: openshift-quickstart
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
  triggers:
  - imageChangeParams:
      automatic: true
      containerNames:
      - openshift-quickstart
      from:
        kind: ImageStreamTag
        name: openshift-quickstart:1.0.0-SNAPSHOT
    type: ImageChange
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  annotations:
    app.openshift.io/vcs-url: <<unknown>>
    app.quarkus.io/build-timestamp: 2021-03-29 - 10:50:37 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.openshift.io/runtime: quarkus
  name: openshift-quickstart
spec:
  port:
    targetPort: 80
  to:
    kind: Service
    name: openshift-quickstart

Environment (please complete the following information):

Quarkus version or git rev

999-SNAPSHOT

(It works fine in 1.12+ and 1.13.0.Final)

Additional context

I think this is another regression issue caused by this change. Another related issue is https://github.com/quarkusio/quarkus/issues/15953

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iocanelcommented, Apr 15, 2021

This has been fixed in dekorate. Will update to the latest version and align tests asap!

1reaction
iocanelcommented, Mar 29, 2021

Not sure if this is behavior between different openshift versions, or a doc issue, but I’ll have to look at it closer. Till then, this can be worked around:

quarkus.openshift.ports.http.name=http
quarkus.openshift.ports.http.host-port=8080
quarkus.openshift.ports.http.container-port=8080
Read more comments on GitHub >

github_iconTop Results From Across the Web

1940498 – pods may fail to add logical port due to lr-nat-del/lr ...
Description of problem: Due to a regression in OVN, executing an lr-nat-del and lr-nat-add in a single transaction causes the following error: ...
Read more >
Troubleshooting Networking | OpenShift Container Platform 3.11
Part of the problem is that OpenShift Container Platform can be set up many ways, and the networking can be wrong in a...
Read more >
OpenShift Container Platform 4.8 release notes
This release uses Kubernetes 1.21 with CRI-O runtime. New features, changes, and known issues that pertain to OpenShift Container Platform 4.8 are included...
Read more >
OpenShift Container Platform 4.9 release notes
Previously, the machine set definitions of compute nodes could not specify whether a port should be trunked. This was a problem for technologies...
Read more >
Routes - Networking | OpenShift Container Platform 3.11
Because a router binds to ports on the host node, only one router listening on those ... If back-ends change, the traffic could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found