From d994ede38a79c7473c74e6d4ad2bcc979a2ebb22 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 20 Mar 2023 17:02:04 +0000 Subject: [PATCH] matrix-media-repo: Add a Podmonitor file --- .../templates/podmonitor.yaml | 20 +++++++++++++++++++ charts/matrix-media-repo/values.yaml | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 charts/matrix-media-repo/templates/podmonitor.yaml diff --git a/charts/matrix-media-repo/templates/podmonitor.yaml b/charts/matrix-media-repo/templates/podmonitor.yaml new file mode 100644 index 0000000..31a55e4 --- /dev/null +++ b/charts/matrix-media-repo/templates/podmonitor.yaml @@ -0,0 +1,20 @@ +{{- if .Values.podmonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ include "matrix-media-repo.fullname" . }} + labels: + {{- include "matrix-media-repo.labels" . | nindent 4 }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + podMetricsEndpoints: + - {{- if .Values.serviceAccount.create }}interval: {{ Values.podmonitor.interval | default "30s"}}{{- end }} + path: /metrics + port: metrics + selector: + matchLabels: + {{- include "matrix-media-repo.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/charts/matrix-media-repo/values.yaml b/charts/matrix-media-repo/values.yaml index da96af8..0f7f355 100644 --- a/charts/matrix-media-repo/values.yaml +++ b/charts/matrix-media-repo/values.yaml @@ -214,6 +214,15 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +## Configure a PodMonitor definition for the application. +## Requires the Prometheus Operator +## +podmonitor: + enabled: false + ## Set the crawl interval (optional) + ## Otherwise uses the default setting set in prometheus + # interval: 30s + ## Node selectors to use when deploying the application. ## nodeSelector: {}