From 0dcf6dd4ce90a36b86a3e6a8f3ec5386a2f9114a Mon Sep 17 00:00:00 2001 From: VILJkid Date: Mon, 26 Aug 2024 16:22:26 +0530 Subject: [PATCH 1/4] (fix) : opensearch and opensearch-dashboards port value bug Signed-off-by: VILJkid --- charts/opensearch-dashboards/CHANGELOG.md | 12 +++++++++++- charts/opensearch-dashboards/Chart.yaml | 2 +- charts/opensearch-dashboards/README.md | 2 +- .../templates/serviceMonitor.yaml | 2 +- charts/opensearch-dashboards/values.yaml | 8 ++++---- charts/opensearch/CHANGELOG.md | 12 +++++++++++- charts/opensearch/Chart.yaml | 2 +- charts/opensearch/README.md | 1 + charts/opensearch/templates/serviceMonitor.yaml | 2 +- charts/opensearch/values.yaml | 4 ++++ 10 files changed, 36 insertions(+), 11 deletions(-) diff --git a/charts/opensearch-dashboards/CHANGELOG.md b/charts/opensearch-dashboards/CHANGELOG.md index b7216f4e..043e6db4 100644 --- a/charts/opensearch-dashboards/CHANGELOG.md +++ b/charts/opensearch-dashboards/CHANGELOG.md @@ -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 @@ -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 diff --git a/charts/opensearch-dashboards/Chart.yaml b/charts/opensearch-dashboards/Chart.yaml index e93db4c5..89a75405 100644 --- a/charts/opensearch-dashboards/Chart.yaml +++ b/charts/opensearch-dashboards/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: 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 diff --git a/charts/opensearch-dashboards/README.md b/charts/opensearch-dashboards/README.md index 041d0535..6fdfc04b 100644 --- a/charts/opensearch-dashboards/README.md +++ b/charts/opensearch-dashboards/README.md @@ -92,9 +92,9 @@ helm uninstall my-release | `opensearchDashboardsYml.defaultMode` | Allow you to set the defaultMode for the opensearch_dashboards.yml mounted as configMap | | | `dashboardAnnotations` | Allows you to configure custom annotation in the deployement of the OpenSearchDashboards container | {} | | `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.portName` | Name of the port in the OpenSearch Dashboards service that exposes metrics. This should match the port name defined in your OpenSearch service configuration. Applicable only if `serviceMonitor.enabled` is set to `true`. | `metrics` | | `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 diff --git a/charts/opensearch-dashboards/templates/serviceMonitor.yaml b/charts/opensearch-dashboards/templates/serviceMonitor.yaml index a978d88c..75924742 100644 --- a/charts/opensearch-dashboards/templates/serviceMonitor.yaml +++ b/charts/opensearch-dashboards/templates/serviceMonitor.yaml @@ -11,7 +11,7 @@ spec: matchLabels: {{- include "opensearch-dashboards.selectorLabels" . | nindent 6 }} endpoints: - - port: {{ .Values.metricsPort }} + - port: {{ .Values.serviceMonitor.portName }} interval: {{ .Values.serviceMonitor.interval }} path: {{ .Values.serviceMonitor.path }} {{- end }} diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index 793cb6a9..0ef30f7a 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -283,6 +283,10 @@ serviceMonitor: # Set to true to enable the ServiceMonitor resource for OpenSearch Dashboards enabled: false + # Specify the port name that Prometheus will use to scrape metrics. + # This should match the name of the port defined in your OpenSearch Dashboards service that exposes metrics. + portName: metrics + # HTTP path where metrics are exposed by OpenSearch Dashboards. # Ensure this path is correctly set in your service. path: /_prometheus/metrics @@ -290,7 +294,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 diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index fedc2a6c..91a2a28c 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 --- +## [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 @@ -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 diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index 22abc6b4..ba7c8342 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: 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 diff --git a/charts/opensearch/README.md b/charts/opensearch/README.md index d68f28d3..d1798200 100644 --- a/charts/opensearch/README.md +++ b/charts/opensearch/README.md @@ -126,6 +126,7 @@ helm uninstall my-release | `lifecycle` | Allows you to configure lifecycle hooks for the OpenSearch container in the StatefulSet | {} | | `openSearchAnnotations` | Allows you to configure custom annotation in the StatefullSet of the OpenSearch container | {} | | `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.portName` | Name of the port in the OpenSearch service that exposes metrics. This should match the port name defined in your OpenSearch service configuration. Applicable only if `serviceMonitor.enabled` is set to `true`. | `metrics` | | `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` | diff --git a/charts/opensearch/templates/serviceMonitor.yaml b/charts/opensearch/templates/serviceMonitor.yaml index 7bc28636..3854956f 100644 --- a/charts/opensearch/templates/serviceMonitor.yaml +++ b/charts/opensearch/templates/serviceMonitor.yaml @@ -11,7 +11,7 @@ spec: matchLabels: {{- include "opensearch.selectorLabels" . | nindent 6 }} endpoints: - - port: {{ .Values.metricsPort }} + - port: {{ .Values.serviceMonitor.portName }} interval: {{ .Values.serviceMonitor.interval }} path: {{ .Values.serviceMonitor.path }} {{- end }} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index ec8d4578..21e14120 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -536,6 +536,10 @@ serviceMonitor: # Set to true to enable the ServiceMonitor resource enabled: false + # Specify the port name that Prometheus will use to scrape metrics. + # This should match the name of the port defined in your OpenSearch service that exposes metrics. + portName: metrics + # HTTP path where metrics are exposed. # Ensure this matches your OpenSearch service configuration. path: /_prometheus/metrics From 45bde8fbdbaded818232dc5cd31ab775c55d8d7b Mon Sep 17 00:00:00 2001 From: VILJkid Date: Tue, 27 Aug 2024 10:07:32 +0530 Subject: [PATCH 2/4] (fix) : referenced metrics configs from opensearch service for opensearch servicemonitor Signed-off-by: VILJkid --- charts/opensearch/README.md | 1 - charts/opensearch/templates/serviceMonitor.yaml | 2 +- charts/opensearch/values.yaml | 6 +----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/charts/opensearch/README.md b/charts/opensearch/README.md index d1798200..d68f28d3 100644 --- a/charts/opensearch/README.md +++ b/charts/opensearch/README.md @@ -126,7 +126,6 @@ helm uninstall my-release | `lifecycle` | Allows you to configure lifecycle hooks for the OpenSearch container in the StatefulSet | {} | | `openSearchAnnotations` | Allows you to configure custom annotation in the StatefullSet of the OpenSearch container | {} | | `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.portName` | Name of the port in the OpenSearch service that exposes metrics. This should match the port name defined in your OpenSearch service configuration. Applicable only if `serviceMonitor.enabled` is set to `true`. | `metrics` | | `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` | diff --git a/charts/opensearch/templates/serviceMonitor.yaml b/charts/opensearch/templates/serviceMonitor.yaml index 3854956f..46b324e5 100644 --- a/charts/opensearch/templates/serviceMonitor.yaml +++ b/charts/opensearch/templates/serviceMonitor.yaml @@ -11,7 +11,7 @@ spec: matchLabels: {{- include "opensearch.selectorLabels" . | nindent 6 }} endpoints: - - port: {{ .Values.serviceMonitor.portName }} + - port: {{ .Values.service.metricsPortName | default "metrics" }} interval: {{ .Values.serviceMonitor.interval }} path: {{ .Values.serviceMonitor.path }} {{- end }} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 21e14120..f82799fb 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -534,11 +534,7 @@ extraObjects: [] # Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service. serviceMonitor: # Set to true to enable the ServiceMonitor resource - enabled: false - - # Specify the port name that Prometheus will use to scrape metrics. - # This should match the name of the port defined in your OpenSearch service that exposes metrics. - portName: metrics + enabled: true # HTTP path where metrics are exposed. # Ensure this matches your OpenSearch service configuration. From 91601fffa5d52ed0758bccd559fc443a1c74a759 Mon Sep 17 00:00:00 2001 From: VILJkid Date: Tue, 27 Aug 2024 10:10:54 +0530 Subject: [PATCH 3/4] (add) : metrics configs in opensearch dashboards service for opensearch dashboards servicemonitor Signed-off-by: VILJkid --- charts/opensearch-dashboards/README.md | 3 ++- charts/opensearch-dashboards/templates/service.yaml | 2 ++ .../opensearch-dashboards/templates/serviceMonitor.yaml | 2 +- charts/opensearch-dashboards/values.yaml | 8 +++----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/charts/opensearch-dashboards/README.md b/charts/opensearch-dashboards/README.md index 6fdfc04b..57def7f0 100644 --- a/charts/opensearch-dashboards/README.md +++ b/charts/opensearch-dashboards/README.md @@ -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` | @@ -92,7 +94,6 @@ helm uninstall my-release | `opensearchDashboardsYml.defaultMode` | Allow you to set the defaultMode for the opensearch_dashboards.yml mounted as configMap | | | `dashboardAnnotations` | Allows you to configure custom annotation in the deployement of the OpenSearchDashboards container | {} | | `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.portName` | Name of the port in the OpenSearch Dashboards service that exposes metrics. This should match the port name defined in your OpenSearch service configuration. Applicable only if `serviceMonitor.enabled` is set to `true`. | `metrics` | | `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` | diff --git a/charts/opensearch-dashboards/templates/service.yaml b/charts/opensearch-dashboards/templates/service.yaml index e520f5c1..e06a8c66 100644 --- a/charts/opensearch-dashboards/templates/service.yaml +++ b/charts/opensearch-dashboards/templates/service.yaml @@ -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 }} diff --git a/charts/opensearch-dashboards/templates/serviceMonitor.yaml b/charts/opensearch-dashboards/templates/serviceMonitor.yaml index 75924742..1f1a2111 100644 --- a/charts/opensearch-dashboards/templates/serviceMonitor.yaml +++ b/charts/opensearch-dashboards/templates/serviceMonitor.yaml @@ -11,7 +11,7 @@ spec: matchLabels: {{- include "opensearch-dashboards.selectorLabels" . | nindent 6 }} endpoints: - - port: {{ .Values.serviceMonitor.portName }} + - port: {{ .Values.service.metricsPortName | default "metrics" }} interval: {{ .Values.serviceMonitor.interval }} path: {{ .Values.serviceMonitor.path }} {{- end }} diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index 0ef30f7a..509673ee 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -156,6 +156,7 @@ service: # ipFamilies: # - IPv4 port: 5601 + metricsPort: 9601 loadBalancerIP: "" nodePort: "" labels: {} @@ -163,6 +164,7 @@ service: loadBalancerSourceRanges: [] # 0.0.0.0/0 httpPortName: http + metricsPortName: metrics ingress: enabled: false @@ -281,11 +283,7 @@ plugins: # Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service. serviceMonitor: # Set to true to enable the ServiceMonitor resource for OpenSearch Dashboards - enabled: false - - # Specify the port name that Prometheus will use to scrape metrics. - # This should match the name of the port defined in your OpenSearch Dashboards service that exposes metrics. - portName: metrics + enabled: true # HTTP path where metrics are exposed by OpenSearch Dashboards. # Ensure this path is correctly set in your service. From b18b06057e09c68ca525b042a0bd2bd6887c4b54 Mon Sep 17 00:00:00 2001 From: VILJkid Date: Tue, 27 Aug 2024 10:20:48 +0530 Subject: [PATCH 4/4] (fix) : disabled the servicemonitor resource Signed-off-by: VILJkid --- charts/opensearch-dashboards/values.yaml | 2 +- charts/opensearch/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index 509673ee..da2494d3 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -283,7 +283,7 @@ plugins: # Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service. serviceMonitor: # Set to true to enable the ServiceMonitor resource for OpenSearch Dashboards - enabled: true + enabled: false # HTTP path where metrics are exposed by OpenSearch Dashboards. # Ensure this path is correctly set in your service. diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index f82799fb..ec8d4578 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -534,7 +534,7 @@ extraObjects: [] # Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service. serviceMonitor: # Set to true to enable the ServiceMonitor resource - enabled: true + enabled: false # HTTP path where metrics are exposed. # Ensure this matches your OpenSearch service configuration.