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

Unable to get basic hello.groovy example working on local single node KIND cluster #3349

Closed
bjethwan opened this issue Jun 11, 2022 · 9 comments
Labels
kind/question Further information is requested status/stale

Comments

@bjethwan
Copy link

bjethwan commented Jun 11, 2022

% kubectl version --short
Client Version: v1.23.1
Server Version: v1.21.1
% kamel version
Camel K Client 1.8.1

https://camel.apache.org/camel-k/1.9.x/running/running.html

kamel run hello.groovy

{"level":"info","ts":1654957525.8224964,"logger":"camel-k","msg":"spectrum - 2022/06/11 14:25:25 Pulling base image adoptopenjdk/openjdk11:slim (insecure=false)..."}
{"level":"error","ts":1654957556.1208284,"logger":"camel-k.controller.build","msg":"Build kit-caiaa4tp090c73cco220 failed: could not pull base image image adoptopenjdk/openjdk11:slim: Get \"https://auth.docker.io/token?scope=repository%3Aadoptopenjdk%2Fopenjdk11%3Apull&service=registry.docker.io\": dial tcp: i/o timeout","request-namespace":"default","request-name":"kit-caiaa4tp090c73cco220","api-version":"camel.apache.org/v1","kind":"Build","ns":"default","name":"kit-caiaa4tp090c73cco220"}
{"level":"info","ts":1654957556.1424239,"logger":"camel-k.controller.build","msg":"state transition","request-namespace":"default","request-name":"kit-caiaa4tp090c73cco220","api-version":"camel.apache.org/v1","kind":"Build","ns":"default","name":"kit-caiaa4tp090c73cco220","phase-from":"Running","phase-to":"Failed"}

It's such a stupid thing that every time it fails to download the base image it again enters in the complete maven build cycle.

@bjethwan
Copy link
Author

% kamel local build --image=docker.io/bjethwan/hello hello.groovy
failure while building project: exit status 1

@bjethwan
Copy link
Author

Does it have to build the image every time I run "kamel run hello.groovy"?

@tadayosi
Copy link
Member

You don't need kamel local build at all for just deploying an integration to a K8s cluster.

Looking at the log, it appears that there is something wrong with the registry settings. Make sure you followed the steps here with the correct credentials:
https://camel.apache.org/camel-k/1.9.x/installation/platform/kind.html

@squakez squakez added the kind/question Further information is requested label Jun 13, 2022
@bjethwan
Copy link
Author

bjethwan commented Jul 6, 2022

@tadayosi I did follow the steps given in https://camel.apache.org/camel-k/1.9.x/installation/platform/kind.html

In fact today I followed the approach

docker login
kubectl create secret generic your-secret-name --from-file ~/.docker/config.json
kamel install --registry docker.io --organization bjethwan --registry-secret your-secret-name

camel-k-example-basic
kamel run Basic.java --dev

{"level":"error","ts":1657137515.1099386,"logger":"camel-k.controller.build","msg":"Build kit-cb2uilvssj1s73ektehg failed: could not pull base image image adoptopenjdk/openjdk11:slim: error getting credentials - err: exec: \"docker-credential-desktop\": executable file not found in $PATH, out: ``","request-namespace":"default","request-name":"kit-cb2uilvssj1s73ektehg","api-version":"camel.apache.org/v1","kind":"Build","ns":"default","name":"kit-cb2uilvssj1s73ektehg"}

{"level":"error","ts":1657138272.6890378,"logger":"camel-k.controller.build","msg":"Build kit-cb2ukqvssj1s73a7kvig failed: could not pull base image image adoptopenjdk/openjdk11:slim: Get \"https://auth.docker.io/token?scope=repository%3Aadoptopenjdk%2Fopenjdk11%3Apull&service=registry.docker.io\": dial tcp: i/o timeout","request-namespace":"default","request-name":"kit-cb2ukqvssj1s73a7kvig","api-version":"camel.apache.org/v1","kind":"Build","ns":"default","name":"kit-cb2ukqvssj1s73a7kvig"}

@bjethwan
Copy link
Author

bjethwan commented Jul 6, 2022

@tadayosi
It did work. I guess it was the network. I changed to mobile hotspot and it worked.

Question: When I re-created the KIND cluster and ran the same integration again, it created the docker image once again when I didn't change a thing in the Integration file Basic.java.
Is there some way to tell it not to build again but re-use the image from last time?

@tadayosi
Copy link
Member

tadayosi commented Jul 7, 2022

@bjethwan If you've just uninstalled Camel K operator, the IntegrationKits used for the build is still there. So long as you keep the IntegrationKits Camel K won't recreate the container image with the hash. As you say, if you recreate the entire kind cluster, or you deleted the entire namespace, the IntegrationKits are also gone and you'll need to rebuild the images.

@bjethwan
Copy link
Author

bjethwan commented Jul 7, 2022

@tadayosi So if I take this solution to production, camel-k will not use the tested kit-* but recreate a new one?
Can't I export and import the integrationkit? Will that skip camel-k from rebuilding in production env?

@squakez
Copy link
Contributor

squakez commented Jul 7, 2022

I think the new kamel promote (#3325) may be your solution. You can already use installing nightly build or waiting for 1.10 release.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Further information is requested status/stale
Projects
None yet
Development

No branches or pull requests

3 participants