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

Support of 3rd party camel components, data formats and type converters #1285

Closed
cenitfish opened this issue Feb 20, 2020 · 19 comments
Closed

Comments

@cenitfish
Copy link

Hello everybody,

Camel K is a cool thing and I think the world was just waiting for it. I have been working with Camel for a long time and have written numerous components for my customers. My question is - are the 3rd party camel components, data formats, type converters also supported and if so how can I use it?

Register new Maven Repository:
kamel install --maven-repository http://myserver:8081/nexus/content/repositories/myrepo@id=myrepo

Example route:
from('mycomponent://foo').to('mock:result')

Run the example route with 3rd party camel components, camel dataformats, camel typeconverter:
kamel run -d mvn:mycompany:mycomponent:1.0 hello.groovy --dev

It would be great if that were possible.

Best wishes
Alex

@lburgazzoli
Copy link
Contributor

This should work out of the box as under the hoods your code is executed by a standard camel application: did you experience any issue ?

@davsclaus
Copy link
Contributor

I think the reporter asked on Camel mailing list, and it was about camel k auto-discovering 3rd party components in the DSL and automatic could map it to maven coordinates. That wont work out of the box. And it would require for example to support installing custom catalog's or something with metadata that describe component scheme/name and its mvn coordinate etc.

@cenitfish
Copy link
Author

Hi Luca,

currently I have the problem that if I pass my dependency with the -d option, an error occurs.

kamel run -d mvn:mycompany:mycomponent:1.0 hello.groovy --dev
integration "hello" created
integration "hello" in phase Initialization
integration "hello" in phase Building Kit
integration "hello" in phase Error
integration deployment failed

kubectl logs camel-k-kit-bp750vabvegtmhqbb5dg-builder
Error from server (BadRequest): container "kaniko" in pod "camel-k-kit-bp750vabvegtmhqbb5dg-builder" is waiting to start: PodInitializing

kubectl describe pod camel-k-kit-bp750vabvegtmhqbb5dg-builder
Events:
Type Reason Age From Message

Normal Scheduled default-scheduler Successfully assigned default/camel-k-kit-bp750vabvegtmhqbb5dg-builder to minikube
Normal Pulled 57s kubelet, minikube Container image "docker.io/apache/camel-k:1.0.0-RC1" already present on machine
Normal Created 57s kubelet, minikube Created container builder
Normal Started 57s kubelet, minikube Started container builder

Do you have any idea what the problem could be?

@lburgazzoli
Copy link
Contributor

@cenitfish can you post the log of the builder pod ? there should be an error there

@cenitfish
Copy link
Author

@lburgazzoli
Here is the complete log from the builder pod:
kubectl logs camel-k-kit-bp750vabvegtmhqbb5dg-builder
Error from server (BadRequest): container "kaniko" in pod "camel-k-kit-bp750vabvegtmhqbb5dg-builder" is waiting to start: PodInitializing

@cenitfish
Copy link
Author

@lburgazzoli
I think the problem is that my Maven artifact is not found even though I have already registered the Maven repository. Can I somehow test whether kamel can access the Maven repository?

@lburgazzoli
Copy link
Contributor

Can you check that the repository is listed among those used by camel-k ? there is a config map named camel-k-maven-settings with a settings.xml key that contains maven' settings

@cenitfish
Copy link
Author

@lburgazzoli
If I use the command kubectl describe pod camel-k*** there is no information about the config map. I suspect that the karaf command could be used for this. I'm sorry, but how do I do that?

@lburgazzoli
Copy link
Contributor

To list all the configmap in your namespace: oc get cm
To get the content of a config map: oc get cm ${name} -o yaml

@cenitfish
Copy link
Author

@lburgazzoli
That's the problem. Unfortunately my maven repository is not listed there.

@lburgazzoli
Copy link
Contributor

can you post the content of the integration platform ? I think when you did ·kamel install a platform was already there so the maven settings have not been updated

@nicolaferraro
Copy link
Member

It's difficult to see the logs because now the maven build is done in an init container and kubectl only display it if you specify the name of the container explicitly.. it should be builder iirc, so kubectl logs -c builder nameofthepod.

Another reason to switch to an embedded build model for 1.0.0, @astefanutti ?

I'd also try to fix the issue that cause the resources not to be replaced when already present in RC2.

@lburgazzoli
Copy link
Contributor

It's difficult to see the logs because now the maven build is done in an init container and kubectl only display it if you specify the name of the container explicitly.. it should be builder iirc, so kubectl logs -c builder nameofthepod.

Another reason to switch to an embedded build model for 1.0.0, @astefanutti ?

I'd also try to fix the issue that cause the resources not to be replaced when already present in RC2.

We may want to have kamel install to fail in case it was already installed and maybe add a flag --force to force the reset of the platform

@astefanutti
Copy link
Member

It's difficult to see the logs because now the maven build is done in an init container and kubectl only display it if you specify the name of the container explicitly.. it should be builder iirc, so kubectl logs -c builder nameofthepod.

Right, that's a side effect of using init containers.

Another reason to switch to an embedded build model for 1.0.0, @astefanutti ?

Yes, that won't rely on init containers.

@lburgazzoli
Copy link
Contributor

@cenitfish did you get it working ?

@cenitfish
Copy link
Author

@igarashitm I updated the config map "camel-k-maven-settings" and my repository is now included. Unfortunately I still get the error:
Error from server (BadRequest): container "kaniko" in pod "camel-k-kit-bp7nnhabveguqppri490-builder" is waiting to start: PodInitializing

I have no idea what's wrong.

@cenitfish
Copy link
Author

After the Camel Reinstall (without updated config map) it now seems to work. I continue with my tests. I'll be in touch when I'm done.

@lburgazzoli
Copy link
Contributor

@cenitfish can we close this issue ?

@cenitfish
Copy link
Author

yes. thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants