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

Add support for mounting volumes with mount trait #5654

Closed
hernanDatgDev opened this issue Jun 17, 2024 · 4 comments · Fixed by #5709
Closed

Add support for mounting volumes with mount trait #5654

hernanDatgDev opened this issue Jun 17, 2024 · 4 comments · Fixed by #5709
Assignees
Labels
area/traits good first issue Does not require full understanding of the codebase kind/feature New feature or request
Milestone

Comments

@hernanDatgDev
Copy link
Contributor

Requirement

As a developer I want a way to add volume references to my integrations and also use the mount trait to mount configmaps/secrets. Currently this is not possible without interfering with the mount trait.

Problem

The pod template can be used to add volume references to an integration however this overrides any volumes/mounts that are set with the mount trait. This leaves a situation where a configmap can be mounted through the mount trait, a pod template can define an emptyDir volume and only the emptyDir from the template will actually propagate to the integration pod resulting in failures.

Proposal

A suggestion from Zulip is to enhance the mount trait to allow for volume support in addition to the existing persistent-volume-claim support.

Open questions

No response

@hernanDatgDev hernanDatgDev added the kind/feature New feature or request label Jun 17, 2024
@squakez squakez added area/traits good first issue Does not require full understanding of the codebase labels Jun 18, 2024
@mdebarros
Copy link
Contributor

Hi @squakez,

Do you have a target release for this feature?

This feature is currently needed to enabled several Sourceless capabilities:

  1. Security hardening to support readOnlyRootFilesystem=false, based on this discussion --> https://camel.zulipchat.com/#narrow/stream/257299-camel-k/topic/pod.20template.20volume.20overrides.20mount.20trait/near/444404000
  2. This would also enable some other use-cases where we want to use init-containers to inject jvmAgents, such as Jolokia.

It would be awesome if we could target this to be part of 2.4.0.

Kind Regards,
Miguel

@hernanDatgDev
Copy link
Contributor Author

Hey @squakez I started work on this and have basically added a case for the emptyDir volume in pkg/trait/trait_types.go getVolume() alongside the other types: configmap, secret, and pvc
I'm in the process of creating a PR but want to get some feedback if this is the expected approach for adding the volume support.

@gansheer
Copy link
Contributor

Hi @hernanDatgDev, thank you for taking care of it! Don't hesitate to submit a PR even if you are still working on it.

@hernanDatgDev
Copy link
Contributor Author

@gansheer Thanks for the heads up. Just created a PR with some comments: #5709
I did run into what I believe is a bug with the kamel promote command. Will be creating a ticket for it.

@squakez squakez added this to the 2.4.0 milestone Jul 26, 2024
@squakez squakez linked a pull request Jul 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/traits good first issue Does not require full understanding of the codebase kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants