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

[Helm] Add option to specify job label for ServiceMonitor #7020

Merged

Conversation

hamza3202
Copy link
Contributor

What this PR does / why we need it:

This PR adds an option to specify spec.jobLabel field for ServiceMonitor. Which can be used to configure prometheus job name based on the value of a label on the service. Using a label on the service as the job name helps organising the jobs and preventing clashes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Ran helm template with default values, spec.jobLabel is not set in the generated yaml. (controller.metrics.enabled and controller.metrics.serviceMonitor.enabled were set to true to enable generation of ServiceMonitor)
  • Ran helm template with custom value for controller.metrics.serviceMonitor.jobLabel, A new field was added in ServiceMonitor with the correct value.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 6, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @hamza3202. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 6, 2021
@hamza3202
Copy link
Contributor Author

/assign @ChiefAlexander

@hamza3202
Copy link
Contributor Author

/assign @cmluciano

@hamza3202
Copy link
Contributor Author

I have created this PR because I mistakenly closed the original PR.

@hamza3202 hamza3202 mentioned this pull request Apr 6, 2021
8 tasks
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 6, 2021
@hamza3202 hamza3202 force-pushed the add-servicemonitor-joblabel branch from 943efc0 to 64b5e5b Compare April 7, 2021 06:11
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 7, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2021
@hamza3202
Copy link
Contributor Author

hamza3202 commented Apr 8, 2021

@ChiefAlexander can you review/merge this PR ASAP? I have had to do rebase a couple of times already.

@ChiefAlexander
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2021
@ChiefAlexander
Copy link
Contributor

/lgtm

@ChiefAlexander
Copy link
Contributor

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ChiefAlexander, hamza3202

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2021
@k8s-ci-robot k8s-ci-robot merged commit f5cfd57 into kubernetes:master Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants