Skip to content

Commit

Permalink
feat(serviceMonitor): add scheme and optional tlsConfig (#647)
Browse files Browse the repository at this point in the history
Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>
  • Loading branch information
eyenx authored Jan 15, 2025
1 parent b27abdd commit 7748183
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
12 changes: 11 additions & 1 deletion charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.35.1]
### Added
- Added scheme for serviceMonitor and optional tlsConfig
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.35.0]
### Added
- Added plugins.removeList to allow remove plugins
Expand Down Expand Up @@ -778,7 +787,8 @@ config:
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.35.0...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.35.1...HEAD
[1.35.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.35.0...opensearch-1.35.1
[1.35.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.34.0...opensearch-1.35.0
[1.34.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.34.0...opensearch-1.33.0
[1.33.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.32.0...opensearch-1.33.0
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.35.0
version: 1.35.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 2 additions & 0 deletions charts/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ helm uninstall my-release
| `serviceMonitor.basicAuth.existingSecret` | When using basicAuth for the serviceMonitor, use an existing secret | `""` |
| `serviceMonitor.basicAuth.username` | Username to be used for basic auth | `""` |
| `serviceMonitor.basicAuth.password` | Password to be used for basic auth | `""` |
| `serviceMonitor.scheme` | scheme to be used for scraping the metrics | `"http"` |
| `serviceMonitor.tlsConfig` | optional tlsConfig to be used for scraping | `{} |

[anti-affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

Expand Down
5 changes: 5 additions & 0 deletions charts/opensearch/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ spec:
- port: {{ .Values.service.httpPortName | default "http" }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
scheme: {{ .Values.serviceMonitor.scheme }}
{{- with .Values.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.basicAuth.enabled }}
basicAuth:
username:
Expand Down
6 changes: 6 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ serviceMonitor:
# Ensure this matches your OpenSearch service configuration.
path: /_prometheus/metrics

# Scheme to use for scraping.
scheme: http

# Frequency at which Prometheus will scrape metrics.
# Adjust based on your needs.
interval: 10s
Expand All @@ -539,6 +542,9 @@ serviceMonitor:
# k8s.example.com/prometheus: kube-prometheus
labels: {}

# additional tlsConfig to be added to the ServiceMonitor
tlsConfig: {}

# Basic Auth configuration for the service monitor
# You can either use existingSecret, which expects a secret to be already present with data.username and data.password
# or set the credentials over the helm values, making helm create a secret for you
Expand Down

0 comments on commit 7748183

Please sign in to comment.