diff --git a/charts/stable/uptime-kuma/Chart.yaml b/charts/stable/uptime-kuma/Chart.yaml index 0c295b6d3d5..90bb9b59834 100644 --- a/charts/stable/uptime-kuma/Chart.yaml +++ b/charts/stable/uptime-kuma/Chart.yaml @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/uptime-kuma - https://github.com/louislam/uptime-kuma type: application -version: 3.0.49 +version: 3.1.0 annotations: truecharts.org/catagories: | - monitoring diff --git a/charts/stable/uptime-kuma/questions.yaml b/charts/stable/uptime-kuma/questions.yaml index c6de05ea9f5..004193cebe2 100644 --- a/charts/stable/uptime-kuma/questions.yaml +++ b/charts/stable/uptime-kuma/questions.yaml @@ -114,6 +114,7 @@ questions: default: 568 # Include{podSecurityContextAdvanced} # Include{resources} +# Include{metrics} # Include{advanced} # Include{addons} # Include{codeserver} diff --git a/charts/stable/uptime-kuma/templates/servicemonitor.yaml b/charts/stable/uptime-kuma/templates/servicemonitor.yaml new file mode 100644 index 00000000000..99036fc3da9 --- /dev/null +++ b/charts/stable/uptime-kuma/templates/servicemonitor.yaml @@ -0,0 +1,26 @@ +{{- if hasKey .Values "metrics" }} +{{- if .Values.metrics.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "tc.common.names.fullname" . }} + labels: + {{- include "tc.common.labels" . | nindent 4 }} + {{- with .Values.metrics.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "tc.common.labels.selectorLabels" . | nindent 6 }} + endpoints: + - port: metrics + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + path: /metrics +{{- end }} +{{- end }} diff --git a/charts/stable/uptime-kuma/values.yaml b/charts/stable/uptime-kuma/values.yaml index 4c2ae571914..db832ca4507 100644 --- a/charts/stable/uptime-kuma/values.yaml +++ b/charts/stable/uptime-kuma/values.yaml @@ -27,3 +27,12 @@ persistence: portal: enabled: true + +metrics: + # -- Enable and configure a Prometheus serviceMonitor for the chart under this key. + # @default -- See values.yaml + enabled: false + serviceMonitor: + interval: 1m + scrapeTimeout: 30s + labels: {}