Skip to content

Commit 22f3730

Browse files
committed
feat: Allow adding extra service selector labels in ServiceMonitor (#673)
Signed-off-by: Erhhung Yuan <[email protected]>
1 parent 4443ee3 commit 22f3730

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

charts/opensearch/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
### Removed
2323
### Fixed
2424
### Security
25+
---
26+
## [3.0.1]
27+
### Added
28+
- Allow adding extra selector labels in ServiceMonitor
29+
### Changed
30+
### Deprecated
31+
### Removed
32+
### Fixed
33+
### Security
2534

2635
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-3.0.0...HEAD
2736
[3.0.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.33.0...opensearch-3.0.0
37+
[3.0.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-3.0.0...opensearch-3.0.1

charts/opensearch/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.0.0
18+
version: 3.0.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/opensearch/templates/serviceMonitor.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ spec:
1313
selector:
1414
matchLabels:
1515
{{- include "opensearch.selectorLabels" . | nindent 6 }}
16+
{{- with .Values.serviceMonitor.selectorLabels }}
17+
{{- toYaml . | nindent 6 }}
18+
{{- end }}
1619
endpoints:
1720
- port: {{ .Values.service.httpPortName | default "http" }}
1821
interval: {{ .Values.serviceMonitor.interval }}

charts/opensearch/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,13 @@ serviceMonitor:
562562
# k8s.example.com/prometheus: kube-prometheus
563563
labels: {}
564564

565+
# additional service selector labels to be added to the ServiceMonitor
566+
# (these could match extra .service.labels or .service.labelsHeadless
567+
# to prevent Prometheus from unnecessarily scraping each target twice)
568+
# selectorLabels:
569+
# prometheus.io/scrape: "true"
570+
selectorLabels: {}
571+
565572
# additional tlsConfig to be added to the ServiceMonitor
566573
tlsConfig: {}
567574

0 commit comments

Comments
 (0)