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.

OpenShift deployment with kubernetes & container-image-docker extension does not work

See original GitHub issue

Describe the bug

The combination of both extensions quarkus-kubernetes and quarkus-container-image-docker for deployment-target=openshift does not work out of the box.

The generated openshift.yml file contains some not needed resources and wrong settings for S2I build (S2I is not in place in my configuration).

To get the deployment done I have to go the OpenShift WebConsole and manually delete the wrong deployment-trigger on the DeploymentConfig and start the deployment.

The following resources are generated by the quarkus-kubernetes extension:

  1. ServiceAccount --> okay
  2. Service --> okay
  3. ImageStream as target for the S2I build --> not needed (must be removed)
  4. ImageStream for S2I builder image --> not needed (must be removed)
  5. BuildConfig for S2I build --> not needed (must be removed)
  6. DeploymentConfig --> not okay because invalid deployment-trigger from S2I ImageStream (must be removed)
...
apiVersion: "apps.openshift.io/v1"
kind: "DeploymentConfig"
...
spec:
  ...
  triggers:
  - imageChangeParams:
      automatic: true
      containerNames:
      - "quarkus-openshift-deployment"
      from:
        kind: "ImageStreamTag"
        name: "quarkus-openshift-deployment:1.0.0-SNAPSHOT"
    type: "ImageChange"
...
  1. Route --> okay

Expected behavior

The combination of the extensions quarkus-kubernetes and quarkus-container-image-docker for deployment-target=openshift should build a container-image, push it to my docker-registry and then deploy only the needed OpenShift resources with a reference to the container-image in the docker-registry.

Actual behavior

The generated openshift.yml file contains some not needed resources and wrong settings for S2I build (S2I is not in place in my configuration). This prevents the automatic deployment to OpenShift without using S2I.

To Reproduce

  1. Bootstrap a new quarkus maven project with the extensions: resteasy-jsonb, smallrye-health, container-image-docker, kubernetes
  2. Add these properties to the application.properties
quarkus.kubernetes-client.trust-certs=true
quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.expose=true
quarkus.openshift.labels.app=quarkus-demo
  1. Login to your OpenShift cluster oc login https://my-openshift-cluster --token=...
  2. Login to your docker-registry docker login ...
  3. Start build with deployment mvn clean package -Dquarkus.kubernetes.deploy=true
  4. Open OpenShift WebConsole to see that deployment was not successful due to reported bug

Environment

  • Quarkus version: 1.5.1-Final
  • Build tool: Maven 3.6.3
  • OpenShift 3.11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Jun 17, 2020

OK, sorry I missread it then 😃

@iocanel I really think the Openshift resources generation needs to be decoupled from S2I

1reaction
haraldatbmwcommented, Jul 21, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying on OpenShift - Quarkus
Since Deployment is a Kubernetes resource and not OpenShift specific, it can't possibly leverage ImageStream resources, as is the case with DeploymentConfig ....
Read more >
Kubernetes Deployments Support | Developer Guide
Kubernetes deployments are supported to ensure upstream projects and examples that use the new object type can run smoothly on OpenShift Container Platform....
Read more >
I'm sorry OpenShift, I've taken you for granted…(the evidence)
One of the simplest ways is to run the “create deployment” command pointing at the container image. kubectl create deployment hello-quarkus — ...
Read more >
Deploy your Quarkus applications on Kubernetes. Almost ...
You want to code Java, not Kubernetes deployment YAML files? ... that is very interesting to everyone using Kubernetes or OpenShift and with ......
Read more >
Kubernetes extension - Quarkus
Currently it supports the generation of resources for vanilla Kubernetes and OpenShift. Furthermore, Quarkus can deploy the application to a target ...
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