Skip to content

Commit

Permalink
fix: add namespaceSelector on serviceMonitor
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Boldiš <richard@boldis.dev>
Signed-off-by: WrenIX <dev.github@wrenix.eu>
  • Loading branch information
2 people authored and WrenIX committed Jan 31, 2024
1 parent f23c107 commit 8868682
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/nextcloud/templates/metrics/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: metrics
namespaceSelector:
{{- with .Values.metrics.serviceMonitor.namespaceSelector }}
{{- toYaml . | nindent 4 }}
{{- else }}
matchNames:
- {{ .Release.Namespace | quote }}
{{- end }}
endpoints:
- port: metrics
path: "/"
Expand Down
3 changes: 3 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@ metrics:
##
namespace: ""

## @param metrics.serviceMonitor.namespaceSelector where service are to discoverd (default release namespace)
namespaceSelector:

## @param metrics.serviceMonitor.jobLabel The name of the label on the target service to use as the job name in prometheus.
##
jobLabel: ""
Expand Down

0 comments on commit 8868682

Please sign in to comment.