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

[nr-k8s-otel-collector] - exposing pod EVs to configuration in values file #1489

Merged
merged 9 commits into from
Oct 11, 2024

Conversation

GHKhuddle1
Copy link
Contributor

@GHKhuddle1 GHKhuddle1 commented Oct 1, 2024

Is this a new chart

No. This is a modification to 'nr-otel-for-k8s', which is currently maintained by @csongnr and @dbudziwojskiNR

What this PR does / why we need it:

This PR exposes the option to add additional pod EVs to the deployment and daemonset running on kubernetes. I ran into a use case where I needed to be able to customize the 'nr-otel-for-k8s' service with a custom collector config, but once I did so I was unable to securely pass values to that config. In order to securely pass values to a custom config, having access from the values file to provide additional EVs is helpful.

Checklist

  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [mychartname])

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2024

CLA assistant check
All committers have signed the CLA.

@GHKhuddle1 GHKhuddle1 changed the title exposing pod EVs to configuration in the values file (nr-k8s-otel-collector) [nr-k8s-otel-collector] - exposing pod EVs to configuration in values file Oct 1, 2024
@GHKhuddle1 GHKhuddle1 marked this pull request as ready for review October 1, 2024 16:28
@GHKhuddle1 GHKhuddle1 requested a review from a team as a code owner October 1, 2024 16:28
Copy link
Contributor

@dbudziwojskiNR dbudziwojskiNR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! Would you please create tests for this new functionality? You can see examples of other tests in tests folder. Thank you!

charts/nr-k8s-otel-collector/templates/daemonset.yaml Outdated Show resolved Hide resolved
@GHKhuddle1
Copy link
Contributor Author

Thanks for your PR! Would you please create tests for this new functionality? You can see examples of other tests in tests folder. Thank you!

I am happy to. I have not used the helm unit testing framework before, but is it safe to say you are using the 'helm-unittest' plugin found here 'https://github.com/helm-unittest/helm-unittest?tab=readme-ov-file'?

I was attempting to run the plugin locally against the tests you already have defined and it appears to fail because it is unable to pull / access your New Relic common library.

error calling include: template: no template "nrKubernetesOtel.deployment.fullname" associated with template "gotpl"

Is there a way to get around this when running the unittesting framework locally? Or would you just copy the contents of the common library and dump it in the local testing directory?

@dbudziwojskiNR
Copy link
Contributor

I am happy to. I have not used the helm unit testing framework before, but is it safe to say you are using the 'helm-unittest' plugin found here 'https://github.com/helm-unittest/helm-unittest?tab=readme-ov-file'?

Thank you! Yes, you have the right link. The common library is publicly accessible. By chance have you run helm dependency update on the chart? It should install the subchart locally allowing the unit tests to run. Please let me know if you're still having issues.

@GHKhuddle1
Copy link
Contributor Author

I am happy to. I have not used the helm unit testing framework before, but is it safe to say you are using the 'helm-unittest' plugin found here 'https://github.com/helm-unittest/helm-unittest?tab=readme-ov-file'?

Thank you! Yes, you have the right link. The common library is publicly accessible. By chance have you run helm dependency update on the chart? It should install the subchart locally allowing the unit tests to run. Please let me know if you're still having issues.

Done. I have made the necessary whitespace changes and created additional testing files for the new functionality. Here is a screenshot of a testing run that passed all tests, including the new ones 'envVar' and 'envVarFrom'. Please let me know if you have any other concerns.

@GHKhuddle1
Copy link
Contributor Author

@dbudziwojskiNR Any update on this?

@dbudziwojskiNR
Copy link
Contributor

@dbudziwojskiNR Any update on this?

Thanks for the tests! Looking into this shortly.

@dbudziwojskiNR dbudziwojskiNR merged commit 87912b5 into newrelic:master Oct 11, 2024
10 checks passed
@dbudziwojskiNR
Copy link
Contributor

@GHKhuddle1 Thank you for your contribution!

@GHKhuddle1 GHKhuddle1 deleted the feature/expose_pod_evs branch October 18, 2024 16:08
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.

3 participants