From e01df938e4d71fa6580ae657f6534280476ca930 Mon Sep 17 00:00:00 2001 From: Toni Tauro Date: Wed, 15 Jan 2025 18:57:24 +0100 Subject: [PATCH] feat(serviceMonitor): add scheme and optional tlsConfig Signed-off-by: Toni Tauro --- charts/opensearch/CHANGELOG.md | 12 +++++++++++- charts/opensearch/Chart.yaml | 2 +- charts/opensearch/README.md | 2 ++ charts/opensearch/templates/serviceMonitor.yaml | 5 +++++ charts/opensearch/values.yaml | 6 ++++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index bf4188bb..46f33a72 100644 --- a/charts/opensearch/CHANGELOG.md +++ b/charts/opensearch/CHANGELOG.md @@ -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 @@ -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 diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index d5cd0860..b942161f 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/Chart.yaml @@ -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 diff --git a/charts/opensearch/README.md b/charts/opensearch/README.md index 3bcd99b6..ca3aa5a8 100644 --- a/charts/opensearch/README.md +++ b/charts/opensearch/README.md @@ -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 diff --git a/charts/opensearch/templates/serviceMonitor.yaml b/charts/opensearch/templates/serviceMonitor.yaml index b56b84bd..0abda693 100644 --- a/charts/opensearch/templates/serviceMonitor.yaml +++ b/charts/opensearch/templates/serviceMonitor.yaml @@ -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: diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 18054d2f..bcde5ba7 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -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 @@ -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