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

Traits to configure the container image and location fo the sources #2232

Closed
lburgazzoli opened this issue Apr 20, 2021 · 7 comments
Closed
Assignees
Milestone

Comments

@lburgazzoli
Copy link
Contributor

We should support traits to configure what container image an integration should use to run integrations as well as where as where sources are located.

As example, it would be nice to be able to define a KameletBinding like:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: my-binding
  annotations:
    trait.camel.apache.org/integration.image: "acme/image:1.0"
    trait.camel.apache.org/integration.sources-mode: "embedded"

Where:

  • the KameletBinding should be executed using the the container image defined by the trait.camel.apache.org/integration.image annotation (no build should be performed)
  • the annotation trait.camel.apache.org/integration.sources-mode: "embedded" instruct the operator that any source are embedded in the container image on a specific location, the operator still need to configure them for the runtime to be able to read but does not need to look them up in k8s.

Relates to: #2165

@lburgazzoli
Copy link
Contributor Author

/cc @nicolaferraro

@nicolaferraro nicolaferraro added this to the 1.5.0 milestone Apr 20, 2021
@nicolaferraro nicolaferraro self-assigned this May 18, 2021
@lburgazzoli
Copy link
Contributor Author

Thinking a little bit about this:

  • We may not need to add an integration.sources-mode but we could probably add an option to set the location of the source on to the source definition, like:
spec:
    sources:
    - location: "{{env.CAMEL_K_SOURCES}}/routes.yaml"
  • for what concern the container images, as we have a pod trait now so we may add an additional option there, like:
kamel run -t pod.integration-image=foo/bar:1.0.0
  • for what concern the kamelets we may add an option to the related trait to list embedded kamelets that the operator should not attempt to look up from k8s
kamel run -t kamelets.embedded=foo,bar,baz

@nicolaferraro
Copy link
Member

I was thinking we could embed the location in the classpath. I'd assume that without information about the sources, the operator is not in a position to compute the right classpath, so that should be provided as part of the container image. So we may only need to choose a (fixed) relative path for sources.

@lburgazzoli
Copy link
Contributor Author

I was thinking we could embed the location in the classpath. I'd assume that without information about the sources, the operator is not in a position to compute the right classpath, so that should be provided as part of the container image. So we may only need to choose a (fixed) relative path for sources.

This is probably true for kamelets but sources it is a little bit more complex so I think, the location of the sources should always be provided. The operator should then ignore any inspection task and only create the "application.properties" where the sources are configured.

Not sure if it makes any sense :)

@github-actions
Copy link
Contributor

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!

@squakez
Copy link
Contributor

squakez commented Apr 21, 2022

I think the first part of the issue is captured by the container.image trait property. @lburgazzoli does the location for the source still make sense?

@lburgazzoli
Copy link
Contributor Author

No, we can close the issue

@squakez squakez closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants