eclipse-jkube / jkube

Build and Deploy java applications on Kubernetes
https://www.eclipse.dev/jkube/
Eclipse Public License 2.0
768 stars 515 forks source link

About jkube version compatibility issues #1406

Open kangjianzhang opened 2 years ago

kangjianzhang commented 2 years ago

Description

Here you say, Maybe some resources might be missing, but overall, we should be compatible. I don't quite understand what "resources " means here.

Info

The deployment.yml and route.yml in the jkube folder can be loaded, but the buildconfig.yml does not take effect, and the debug log does not show any problems. I suspect it is a version compatibility problem. Is this the resource you mentioned above that might be lost?

manusa commented 2 years ago

Hi, resources refers to any apiGroup+Kind resource (e.g. Pod, etc.). The PR mentions that some typed resources might be missing for direct manipulation, but this shouldn't bother you if you are providing fragments or complete YAML files.

Regarding the BuildConfig resource, it should be definitely supported. However, depending on what you're trying to accomplish it might not be the appropriate way.

It would help to find out the issue if you could provide some reproducing code or project.

kangjianzhang commented 2 years ago

image image image image image The above is all my configuration.

kangjianzhang commented 2 years ago

This is my execution log, please focus on these two paragraphs.

[INFO] --- openshift-maven-plugin1.7.0resource (default) @ ubip-poc-fabric8 --- [INFO] oc Using docker image name of namespace ubip-dev [INFO] oc Running generator spring-boot [INFO] oc spring-boot Using Docker image quay.iojkubejkube-java0.0.13 as base builder

[INFO] --- openshift-maven-plugin1.7.0apply (default) @ ubip-poc-fabric8 --- [INFO] oc OpenShift platform detected [INFO] oc Using OpenShift at https://api.paas-test.com:6443 in namespace null with manifest C:/Users/IdeaProjects/ubip-poc-fabric8/target/classes/META-INF/jkube/openshift.yml [INFO] oc Updating Service from openshift.yml

When executing the resource command, the content in buildconfig.yml is not used, but it is used when executing the apply command. This will cause me to create two buildconfigs. One of them uses the buildconfig.yml configuration and the other uses the default configuration (spring-boot generator).

kangjianzhang commented 2 years ago

Dear @manusa, The above is my example, please help to answer, thank you very much.

manusa commented 2 years ago

Hi, sorry for the late reply.

OK, in your case you're trying to override our default S2i binary build. I initially thought that you might want to provide a buildconfig to perform an S2i source build.

For the binary build, the only way to go is to use our built-in features and XML/DSL configurations. In the end, you need JKube to orchestrate this since the binary needs to be streamed to the cluster too.

Checking your snippet, I'm unsure of what you're actually trying to customize there, and which options you might be lacking.

kangjianzhang commented 2 years ago

Hi @manusa,

I thought about your reply carefully. I found the cause of the problem. The buildconfig.yml defined in jkube is different from the buildconfig in OCP(OpenShift Container Platform), which caused my buildconfig.yml to not take effect.

I have a few questions.

  1. I initially thought that you might want to provide a buildconfig to perform an S2i source build. What do you mean by buildconfig here, can you give an example?
  2. What does built-in features refer to, I don't quite understand
  3. I want to know how to define the buildconfig of OCP in jkube?

Looking forward to your reply!