From a88a8045675bed2e95160465c8c3191fc6ac3aae Mon Sep 17 00:00:00 2001 From: Pierluigi Lenoci Date: Mon, 13 Nov 2023 11:51:51 +0100 Subject: [PATCH 1/2] Fixed the case for serviceMonitor values section --- helm/oauth2-proxy/README.md | 12 ++++++------ helm/oauth2-proxy/templates/servicemonitor.yaml | 16 ++++++++-------- helm/oauth2-proxy/values.yaml | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/helm/oauth2-proxy/README.md b/helm/oauth2-proxy/README.md index 730ea207..1cfe0af5 100644 --- a/helm/oauth2-proxy/README.md +++ b/helm/oauth2-proxy/README.md @@ -201,12 +201,12 @@ Parameter | Description | Default `metrics.port` | Serve Prometheus metrics on this port | `44180` `metrics.nodePort` | External port for the metrics when service.type is `NodePort` | `nil` `metrics.service.appProtocol` | application protocol of the metrics port in the service | `http` -`metrics.servicemonitor.enabled` | Enable Prometheus Operator ServiceMonitor | `false` -`metrics.servicemonitor.namespace` | Define the namespace where to deploy the ServiceMonitor resource | `""` -`metrics.servicemonitor.prometheusInstance` | Prometheus Instance definition | `default` -`metrics.servicemonitor.interval` | Prometheus scrape interval | `60s` -`metrics.servicemonitor.scrapeTimeout` | Prometheus scrape timeout | `30s` -`metrics.servicemonitor.labels` | Add custom labels to the ServiceMonitor resource| `{}` +`metrics.serviceMonitor.enabled` | Enable Prometheus Operator ServiceMonitor | `false` +`metrics.serviceMonitor.namespace` | Define the namespace where to deploy the ServiceMonitor resource | `""` +`metrics.serviceMonitor.prometheusInstance` | Prometheus Instance definition | `default` +`metrics.serviceMonitor.interval` | Prometheus scrape interval | `60s` +`metrics.serviceMonitor.scrapeTimeout` | Prometheus scrape timeout | `30s` +`metrics.serviceMonitor.labels` | Add custom labels to the ServiceMonitor resource| `{}` `extraObjects` | Extra K8s manifests to deploy | `[]` Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/helm/oauth2-proxy/templates/servicemonitor.yaml b/helm/oauth2-proxy/templates/servicemonitor.yaml index 1a2dbce1..e321c457 100644 --- a/helm/oauth2-proxy/templates/servicemonitor.yaml +++ b/helm/oauth2-proxy/templates/servicemonitor.yaml @@ -1,19 +1,19 @@ -{{- if and .Values.metrics.enabled .Values.metrics.servicemonitor.enabled }} +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "oauth2-proxy.fullname" . }} -{{- if .Values.metrics.servicemonitor.namespace }} - namespace: {{ .Values.metrics.servicemonitor.namespace }} +{{- if .Values.metrics.serviceMonitor.namespace }} + namespace: {{ .Values.metrics.serviceMonitor.namespace }} {{- else }} namespace: {{ template "oauth2-proxy.namespace" $ }} {{- end }} labels: - prometheus: {{ .Values.metrics.servicemonitor.prometheusInstance }} + prometheus: {{ .Values.metrics.serviceMonitor.prometheusInstance }} app: {{ template "oauth2-proxy.name" . }} {{- include "oauth2-proxy.labels" . | indent 4 }} -{{- if .Values.metrics.servicemonitor.labels }} -{{ toYaml .Values.metrics.servicemonitor.labels | indent 4}} +{{- if .Values.metrics.serviceMonitor.labels }} +{{ toYaml .Values.metrics.serviceMonitor.labels | indent 4}} {{- end }} spec: jobLabel: {{ template "oauth2-proxy.fullname" . }} @@ -26,6 +26,6 @@ spec: endpoints: - port: metrics path: "/metrics" - interval: {{ .Values.metrics.servicemonitor.interval }} - scrapeTimeout: {{ .Values.metrics.servicemonitor.scrapeTimeout }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} {{- end }} diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index 8d73d27d..fdc310a8 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -359,7 +359,7 @@ metrics: # Protocol set on the service for the metrics port service: appProtocol: http - servicemonitor: + serviceMonitor: # Enable Prometheus Operator ServiceMonitor enabled: false # Define the namespace where to deploy the ServiceMonitor resource From f202dedcd5fa8639f88db591300acf0ffceaa397 Mon Sep 17 00:00:00 2001 From: Pierluigi Lenoci Date: Mon, 13 Nov 2023 11:53:48 +0100 Subject: [PATCH 2/2] Chart bump --- helm/oauth2-proxy/Chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index 898e1594..876bb543 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 6.18.1 +version: 6.18.2 apiVersion: v2 appVersion: 7.5.1 home: https://oauth2-proxy.github.io/oauth2-proxy/ @@ -35,7 +35,7 @@ kubeVersion: ">=1.9.0-0" annotations: artifacthub.io/changes: | - kind: added - description: Define image repository & pullPolicy on the initContainer wait-for-redis + description: Fixed the case for serviceMonitor values section links: - name: Github PR - url: https://github.com/oauth2-proxy/manifests/pull/166 + url: https://github.com/oauth2-proxy/manifests/pull/171