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 user-specified instrumentation volume #3285

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jnarezo
Copy link

@jnarezo jnarezo commented Sep 12, 2024

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 and VolumeSizeLimit being defined simultaneously to prevent overlapping behavior (ex. Do we use Volume.Size or VolumeSizeLimit?)

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.

@jnarezo jnarezo requested a review from a team September 12, 2024 04:31
Copy link

linux-foundation-easycla bot commented Sep 12, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Contributor

@swiatekm swiatekm left a 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.

pkg/instrumentation/helper.go Outdated Show resolved Hide resolved
pkg/instrumentation/helper.go Outdated Show resolved Hide resolved
@jnarezo
Copy link
Author

jnarezo commented Sep 13, 2024

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.

@swiatekm
Copy link
Contributor

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 corev1.Volume is actually quite large, and we're including a copy of it for each language instrumentation. As a result, we're making the Instrumentation CRD much larger. There are consequences to this - for example, if the CRD is too big to fit in a K8s annotation (the limit is ~256kb), then it can't be applied using kubectl apply anymore. Your change pushes the Instrumentation CRD above that limit.

I'm not sure what we can do to alleviate this. We could make the Volume attribute common to all instrumentations. It would make it less flexible, but maybe that's ok? @jaronoff97 @pavolloffay WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow references to other volumes (eg. PVCs) for instrumention auto-inject
2 participants