feat: add additionalLabels to Service Monitor #366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
✅ Checks
ℹ Additional Information
For the reviewer testing this, you can run these tests.
Scenario 1: Run helm chart without the additional labels
in the values.yaml, only use the serviceMonitor enable is true as follows:
Scenario 2: Run helm chart with the additional labels
in the values.yaml, only use the serviceMonitor enable is true and add labels as follows:
To test the values run this command in the root directory:
helm install ./charts/k8sgpt --dry-run --devel --generate-name > manifests.yaml
Then look in the manifests.yaml file and search throught it (remember to delete it)