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

kamel local run/build practices for creating a YAML output #3021

Closed
catshout opened this issue Feb 17, 2022 · 10 comments · Fixed by #3198
Closed

kamel local run/build practices for creating a YAML output #3021

catshout opened this issue Feb 17, 2022 · 10 comments · Fixed by #3198
Labels
area/cli Kamel CLI kind/feature New feature or request

Comments

@catshout
Copy link

catshout commented Feb 17, 2022

We're running some kind of

kamel run <file>.java -o yaml > <file>.yaml

to create a yaml file for our CD pipeline based on FluxCD.

Does this also work locally w/o a cluster in place? e.g.

kamel local run <file>.java -o yaml > <file>.yaml

With the command I'm getting

Error: unknown shorthand flag: 'o' in -o

So is there any other possibility to create the yaml file without the k8s cluster connectivity?

@catshout catshout changed the title kamel local run/build practices kamel local run/build practices for creating a YAML output Feb 17, 2022
@squakez
Copy link
Contributor

squakez commented Feb 21, 2022

Not through the kamel local unfortunately. Basically, the local subcommand is in charge to run the java application without knowing anything about Kubernetes. As the Integration is a CRD thought for Kubernetes, it makes sense to have a connected environment taking care of that as well.

@squakez squakez added the kind/question Further information is requested label Feb 21, 2022
@catshout
Copy link
Author

Thanks for your reply @squakez.

Background of my question ist that we have an independent CD pipeline. For a YAML creation we need to create every time a Minikube on the build system and drop it afterwards. A lot of effort ..

So the independent (disconnected) YAML creation would be appreciated, if this is possible.

@catshout
Copy link
Author

catshout commented Mar 9, 2022

@squakez, @astefanutti, question here as well, might this become a feature request? Or is the connection to the Operator in fact necessary to do things especially for this part of the YAML creation?

@imartinez-tws
Copy link

Hi, we are also evaluating camel k and we were wondering if it is possible to externalise the build phase and image generation (e.g. running kamel local build) from an external CI/CD system and just be able to run from generated image. Maybe it is already possible but I haven't found any guideline that explain how to do this.

Thanks in advance.

@squakez
Copy link
Contributor

squakez commented Mar 31, 2022

I got this off my radar... so, I had a further look, and the actual implementation requires the CLI to be connected to a cluster as it delegates the print. I think it can makes sense to have the CLI being able to work disconnected (ie via -o yaml mode). I'm marking this as a feature and we can keep discussing about pros and cons of the "disconnected" approach.

@squakez squakez added kind/feature New feature or request area/cli Kamel CLI and removed kind/question Further information is requested labels Mar 31, 2022
@catshout
Copy link
Author

catshout commented Mar 31, 2022 via email

@heiko-braun
Copy link

We are doing out of band builds and run the images with operator. @lburgazzoli can provide more details

squakez added a commit to squakez/camel-k that referenced this issue Apr 13, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit to squakez/camel-k that referenced this issue Apr 18, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit to squakez/camel-k that referenced this issue Apr 19, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
@imartinez-tws
Copy link

Hi, I think the linked PR probably solves the generation of the YAML output with no dependencies to the cluster, but what about the integrationkit image?. Is there any way of producing the image without the cluster and then pass it as a reference whn using kamel run (e.g. kamel run -t container.image=)?

@squakez
Copy link
Contributor

squakez commented Apr 21, 2022

Hello. Yes, you can use container trait for that likely -t container.image=my-kit : https://camel.apache.org/camel-k/next/traits/container.html

Not sure if we can really create the image disconnected from the cluster because, at least you need to publish it to the related registry.

@imartinez-tws
Copy link

imartinez-tws commented Apr 21, 2022

Hello. Yes, you can use container trait for that likely -t container.image=my-kit : https://camel.apache.org/camel-k/next/traits/container.html

Not sure if we can really create the image disconnected from the cluster because, at least you need to publish it to the related registry.

Thanks for the info.

Well, a CI/CD system usually takes care of image publishing after successful build so it can be referenced by k8s resources on deployment. The idea is keep the operator connected to the registry so it can get the image referenced by container.image, but that image being pushed from CI/CD system.

One of the main advantages of using external CI/CD is that we could have custom version numbers for the releases we are producing

squakez added a commit to squakez/camel-k that referenced this issue Apr 22, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit to squakez/camel-k that referenced this issue Apr 22, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit to squakez/camel-k that referenced this issue Apr 28, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit to squakez/camel-k that referenced this issue May 5, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes apache#3021
squakez added a commit that referenced this issue May 5, 2022
If we detect the -o option, then the CLI goes in offline mode, allowing to be used without a K8S cluster.

Closes #3021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants