Skip to content

Commit

Permalink
[opensearch] serviceMonitor: add scheme and optional tlsConfig (#639)
Browse files Browse the repository at this point in the history
* feat(serviceMonitor): add scheme and optional tlsConfig

Signed-off-by: Toni Tauro <[email protected]>

* fix(sm): trailing spaces

Signed-off-by: Toni Tauro <[email protected]>

* fix(values): trailing spaces

Signed-off-by: Toni Tauro <[email protected]>

* fix(version): bump to patchfix

Signed-off-by: Toni Tauro <[email protected]>

---------

Signed-off-by: Toni Tauro <[email protected]>
  • Loading branch information
eyenx authored Jan 15, 2025
1 parent 74706b8 commit 78833d6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
14 changes: 12 additions & 2 deletions 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
---
## [2.30.1]
### Added
- Added scheme for serviceMonitor and optional tlsConfig
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [2.30.0]
### Added
- Added plugins.removeList to allow remove plugins
Expand Down Expand Up @@ -557,8 +566,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.30.0...HEAD
[2.29.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.29.0...opensearch-2.30.0
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.30.1...HEAD
[2.30.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.30.0...opensearch-2.30.1
[2.30.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.29.0...opensearch-2.30.0
[2.29.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.28.0...opensearch-2.29.0
[2.28.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.27.1...opensearch-2.28.0
[2.27.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.27.0...opensearch-2.27.1
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: 2.30.0
version: 2.30.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 @@ -132,6 +132,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
[environment from variables]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
Expand Down
7 changes: 6 additions & 1 deletion charts/opensearch/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ 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:
username:
{{- if .Values.serviceMonitor.basicAuth.existingSecret }}
name: {{ .Values.serviceMonitor.basicAuth.existingSecret }}
{{- else }}
Expand Down
6 changes: 6 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,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 @@ -559,6 +562,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 78833d6

Please sign in to comment.