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 deployment with kubernetes & container-image-docker extension does not work #10055

Closed
haraldatbmw opened this issue Jun 16, 2020 · 16 comments · Fixed by #10434
Closed
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@haraldatbmw
Copy link
Contributor

haraldatbmw commented Jun 16, 2020

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
@haraldatbmw haraldatbmw added the kind/bug Something isn't working label Jun 16, 2020
@geoand
Copy link
Contributor

geoand commented Jun 17, 2020

Yeah... The openshift extension is only really meant to be used with S2I, it's not ideal.

I would suggest for the time being to use the vanilla kubernetes extension and apply quarkus.kubernetes.deployment-target=openshift.

cc @iocanel

@haraldatbmw
Copy link
Contributor Author

@geoand I do not use the openshift extension. I know this is for S2I only. I already use the vanilla kubernetes extension. And this issue is all about the kubernetes extension with target=openshift.

@geoand
Copy link
Contributor

geoand commented Jun 17, 2020

OK, sorry I missread it then :)

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

@geoand
Copy link
Contributor

geoand commented Jul 8, 2020

@iocanel this is it pending a dekorate release IIRC, right?

@haraldatbmw
Copy link
Contributor Author

@iocanel @geoand Let me know when the new dekorate release is in place inside quarkus master branch. Then i will give it a test to my openshift environment.

@geoand
Copy link
Contributor

geoand commented Jul 13, 2020

@haraldatbmw yeah, there is a new dekorate release in master, so if could give it a try, we would be grateful.

@haraldatbmw
Copy link
Contributor Author

@geoand Just tried with the current master branch without success. The generated openshift.yml still contains the whole S2I stuff.

@geoand
Copy link
Contributor

geoand commented Jul 13, 2020

Thanks @haraldatbmw

@iocanel can you shine some light on what the status of this is?

@iocanel
Copy link
Contributor

iocanel commented Jul 14, 2020

We have a PR pending. Once the tests pass, we will merge.

@geoand
Copy link
Contributor

geoand commented Jul 14, 2020

@iocanel can you please link the PR to this issue so it will be closed once the PR is merged?

@iocanel iocanel self-assigned this Jul 14, 2020
@geoand
Copy link
Contributor

geoand commented Jul 15, 2020

@haraldatbmw mind giving this another go?

Thanks

@haraldatbmw
Copy link
Contributor Author

@geoand Now it looks better. Deployment to Openshift works. But two additional findings.

  1. Massiv log-output from the kubernetes extension
  2. I think the generated trigger inside the deployment-config causes double deployment (If i call mvn clean package -Dquarkus.kubernetes.deploy=true then the deployment-counter in openshift increments by two)

@geoand
Copy link
Contributor

geoand commented Jul 16, 2020

@geoand Now it looks better. Deployment to Openshift works. But two additional findings.

Thanks for checking!

  1. Massiv log-output from the kubernetes extension

That has since been fixed

  1. I think the generated trigger inside the deployment-config causes double deployment (If i call mvn clean package -Dquarkus.kubernetes.deploy=true then the deployment-counter in openshift increments by two)

@iocanel ^

@gsmet gsmet added this to the 1.7.0 - master milestone Jul 17, 2020
@haraldatbmw
Copy link
Contributor Author

@geoand Should I open a new issue for the double-deployment thing?

@geoand
Copy link
Contributor

geoand commented Jul 20, 2020

Yes please

@haraldatbmw
Copy link
Contributor Author

Just created #10875

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

Successfully merging a pull request may close this issue.

4 participants