diff --git a/charts/matrix-media-repo/templates/deployment.yaml b/charts/matrix-media-repo/templates/deployment.yaml index cde272b..e183681 100644 --- a/charts/matrix-media-repo/templates/deployment.yaml +++ b/charts/matrix-media-repo/templates/deployment.yaml @@ -61,6 +61,9 @@ spec: - name: http containerPort: 8000 protocol: TCP + - name: metrics + containerPort: 9000 + protocol: TCP livenessProbe: httpGet: path: /healthz diff --git a/charts/matrix-media-repo/templates/podmonitor.yaml b/charts/matrix-media-repo/templates/podmonitor.yaml new file mode 100644 index 0000000..d7267d1 --- /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: + - path: /metrics + port: metrics + {{ if .Values.podmonitor.interval }}interval: {{ .Values.podmonitor.interval }}{{ end }} + 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: {}