Skip to content

Commit

Permalink
Merge pull request #171 from pierluigilenoci/servicemonitorcaseissue
Browse files Browse the repository at this point in the history
Fixed the case for serviceMonitor values section
  • Loading branch information
pierluigilenoci committed Nov 13, 2023
2 parents ef146ac + f202ded commit 33d0bec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions helm/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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/
Expand Down Expand Up @@ -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
12 changes: 6 additions & 6 deletions helm/oauth2-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions helm/oauth2-proxy/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -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" . }}
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion helm/oauth2-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33d0bec

Please sign in to comment.