Skip to content

Commit

Permalink
[Fix] OpenSearch and OpenSearch Dashboards Service Monitor Bug (opens…
Browse files Browse the repository at this point in the history
…earch-project#581)

* (fix) : opensearch and opensearch-dashboards port value bug

Signed-off-by: VILJkid <[email protected]>

* (fix) : referenced metrics configs from opensearch service for opensearch servicemonitor

Signed-off-by: VILJkid <[email protected]>

* (add) : metrics configs in opensearch dashboards service for opensearch dashboards servicemonitor

Signed-off-by: VILJkid <[email protected]>

* (fix) : disabled the servicemonitor resource

Signed-off-by: VILJkid <[email protected]>

---------

Signed-off-by: VILJkid <[email protected]>
  • Loading branch information
VILJkid authored Aug 28, 2024
1 parent 7d1885f commit e811d1c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
12 changes: 11 additions & 1 deletion charts/opensearch-dashboards/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.21.1]
### Added
### Changed
### Deprecated
### Removed
### Fixed
- Fixed `ServiceMonitor` bug for `port` value
### Security
---
## [2.21.0]
### Added
- Added `ServiceMonitor` support for Prometheus monitoring
Expand Down Expand Up @@ -368,7 +377,8 @@ 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-dashboards-2.21.0...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.21.1...HEAD
[2.21.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.21.0...opensearch-dashboards-2.21.1
[2.21.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.20.0...opensearch-dashboards-2.21.0
[2.20.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.19.1...opensearch-dashboards-2.20.0
[2.19.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.19.0...opensearch-dashboards-2.19.1
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/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.21.0
version: 2.21.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
3 changes: 2 additions & 1 deletion charts/opensearch-dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ helm uninstall my-release
| `service.type` | OpenSearch [Service Types][] | `ClusterIP` |
| `service.ipFamilyPolicy` | This sets the preferred ip addresses in case of a dual-stack server, there are three options [PreferDualStack, SingleStack, RequireDualStack], [more information on dual stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) | `""` |
| `service.ipFamilies` | Sets the preferred IP variants and in which order they are preferred, the first family you list is used for the legacy .spec.ClusterIP field, [more information on dual stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) | `""` |
| `service.metricsPort` | The metrics port (for Performance Analyzer) that Kubernetes will use for the service. | `9601` |
| `service.metricsPortName` | The name of the metrics port (for Performance Analyzer) within the service | `metrics` |
| `tolerations` | Configurable [tolerations][] | `[]` |
| `topologySpreadConstraints` | Configuration for pod [topologySpreadConstraints][] | `[]` |
| `updateStrategy` | The [updateStrategy][] for the StatefulSet. By default Kubernetes will wait for the cluster to be green after upgrading each pod. Setting this to `OnDelete` will allow you to manually delete each pod during upgrades | `RollingUpdate` |
Expand All @@ -94,7 +96,6 @@ helm uninstall my-release
| `serviceMonitor.enabled` | Enables the creation of a [ServiceMonitor] resource for Prometheus monitoring. Requires the Prometheus Operator to be installed in your Kubernetes cluster. | `false` |
| `serviceMonitor.path` | Path where metrics are exposed. Applicable only if `serviceMonitor.enabled` is set to `true`. | `/_prometheus/metrics` |
| `serviceMonitor.interval` | Interval at which metrics should be scraped by Prometheus. Applicable only if `serviceMonitor.enabled` is set to `true`. | `10s` |
| `metricsPort` | The metrics port (for Performance Analyzer) that Kubernetes will use for the service. | `9601` |

[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
2 changes: 2 additions & 0 deletions charts/opensearch-dashboards/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
protocol: TCP
name: {{ .Values.service.httpPortName | default "http" }}
targetPort: {{ .Values.service.port }}
- name: {{ .Values.service.metricsPortName | default "metrics" }}
port: {{ .Values.service.metricsPort }}
selector:
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
matchLabels:
{{- include "opensearch-dashboards.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.metricsPort }}
- port: {{ .Values.service.metricsPortName | default "metrics" }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
{{- end }}
6 changes: 2 additions & 4 deletions charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,15 @@ service:
# ipFamilies:
# - IPv4
port: 5601
metricsPort: 9601
loadBalancerIP: ""
nodePort: ""
labels: {}
annotations: {}
loadBalancerSourceRanges: []
# 0.0.0.0/0
httpPortName: http
metricsPortName: metrics

ingress:
enabled: false
Expand Down Expand Up @@ -290,7 +292,3 @@ serviceMonitor:
# Frequency at which Prometheus will scrape metrics.
# Modify as needed for your monitoring requirements.
interval: 10s

# Port configuration for metrics.
# This should match the port exposed by the OpenSearch Dashboards service.
metricsPort: 9601
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
---
## [2.23.1]
### Added
### Changed
### Deprecated
### Removed
### Fixed
- Fixed `ServiceMonitor` bug for `port` value
### Security
---
## [2.23.0]
### Added
- Added `ServiceMonitor` support for Prometheus monitoring
Expand Down Expand Up @@ -450,7 +459,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security


[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.23.0...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.23.1...HEAD
[2.23.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.23.0...opensearch-2.23.1
[2.23.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.22.1...opensearch-2.23.0
[2.22.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.22.0...opensearch-2.22.1
[2.22.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.21.0...opensearch-2.22.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: 2.23.0
version: 2.23.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: 1 addition & 1 deletion charts/opensearch/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
matchLabels:
{{- include "opensearch.selectorLabels" . | nindent 6 }}
endpoints:
- port: {{ .Values.metricsPort }}
- port: {{ .Values.service.metricsPortName | default "metrics" }}
interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
{{- end }}

0 comments on commit e811d1c

Please sign in to comment.