Skip to content

Commit

Permalink
fix: add namespaceSelector on serviceMonitor
Browse files Browse the repository at this point in the history
Signed-off-by: WrenIX <[email protected]>
  • Loading branch information
wrenix committed Nov 22, 2023
1 parent c6b3649 commit 6ea64c0
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 @@ -516,6 +516,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 6ea64c0

Please sign in to comment.