-
Notifications
You must be signed in to change notification settings - Fork 450
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 user-specified instrumentation volume #3285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good to me overall. Some things missing before we can merge this PR:
- You need to add a changelog entry. Run
make chlog-new
and fill in the template. - Run
make precommit
and fix any issues it brings up. Right now, the CI is failing because the bundle needs to be updated after changes to CRDs. - We should check this volume mechanism in E2E tests. It's fine to modify an existing test.
Thanks, got it working locally! Was using golang v1.23.x and pipeline was broken on me, so I downgraded. |
The PR looks great, thanks for the contribution! There's one big problem with it, and to be clear, this is really Kubernetes' fault. As it turns out, the OpenAPI spec for I'm not sure what we can do to alleviate this. We could make the |
Hey @swiatekm, sorry I dropped this for a bit, but I saw that there was no response on your question. I redesigned the feature to accept a Although more restrictive that originally planned, I think this still provides about the functionality as an emptyDir and will still allow users with emptyDir restrictions to use a different type of volume, supported by storage drivers. I think this should work for now. An alternative could be using an existing PVC, but there may be issues with files already existing from previous autoinstrumentation so I did not pursue it further. What do you think? |
Also, restricting the volume allowed me to get the manifest down to ~80KB. |
@jnarezo this looks like a reasonable solution to me. Pending any more fundamental changes to the CRD, where we perhaps move all of these common values to the top level, this looks like a good compromise. WDYT @jaronoff97 @pavolloffay ? Looks like you have some conflicts and failing e2e tests, could you have a look at that? |
Yeah! Sorry, looks like my e2e differed a bit locally. Thanks for working with me on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one thought, otherwise this looks good. thank you 🙇
// VolumeClaimTemplate defines a ephemeral volume used for auto-instrumentation. | ||
// If omitted, an emptyDir is used with size limit VolumeSizeLimit | ||
VolumeClaimTemplate corev1.PersistentVolumeClaimTemplate `json:"volumeClaimTemplate,omitempty"` | ||
|
||
// VolumeSizeLimit defines size limit for volume used for auto-instrumentation. | ||
// The default size is 200Mi. | ||
VolumeSizeLimit *resource.Quantity `json:"volumeLimitSize,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just deprecate this in favor of the volume claim template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's open a separate issue for that, I don't think it should be within the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description:
Adds the ability for user to specify a custom volume for instrumentation / auto-injection to
Instrumentation.spec.<lang>.volumeSizeLimit
.Adds validation to prevent
Volume
andVolumeSizeLimit
being defined simultaneously to prevent overlapping behavior (ex. Do we useVolume.Size
orVolumeSizeLimit
?)Link to tracking Issue(s):
Testing:
Unit tests for validation with different combinations of Volume/VolumeSizeLimit being defined and not defined
Documentation:
Updated API docs with new spec.