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

feat: add additionalLabels to serviceMonitor #51

Conversation

bradmccoydev
Copy link
Member

Closes #364

📑 Description

This PR is to add the ability to add your own labels to the service monitor. In my case I use the Prometheus operator therefore I need to add an additional label so it references my prometheus release which is:

labels:
  release: kube-prometheus-stack

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

For the reviewer testing this, you can run these tests.

Scenario 1: Run helm chart with service monitor enabled is false

in the values.yaml, the serviceMonitor enabled is false as follows:

serviceMonitor:
  enabled: false

Scenario 2: Run helm chart without the additional labels

in the values.yaml, only use the serviceMonitor enable is true as follows:

serviceMonitor:
  enabled: true

Scenario 3: Run helm chart with the additional labels

in the values.yaml, only use the serviceMonitor enable is true and add labels as follows:

serviceMonitor:
  enabled: true
  additionalLabels:
    release: kube-prometheus-stack

To test the values run this command in the root directory:

helm install ./chart/operator--dry-run --devel --generate-name > manifests.yaml

Then look in the manifests.yaml file and search throught it (remember to delete it)

Signed-off-by: Brad McCoy <bradmccoydev@gmail.com>
Signed-off-by: Brad McCoy <bradmccoydev@gmail.com>
@AlexsJones
Copy link
Member

Thanks @bradmccoydev would you mind adding this to the README in the table of available helm values?

@AlexsJones AlexsJones merged commit d8497fc into k8sgpt-ai:main May 2, 2023
6 checks passed
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.

None yet

2 participants