diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index a39382bde94081f02b04d368116d9a6817d00a09..4c72aab0193ff6fe1453dc61b5971e490a225d3a 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deploy/helm/templates/servicemonitor.yaml b/deploy/helm/templates/servicemonitor.yaml new file mode 100644 index 0000000000000000000000000000000000000000..08d920236e3c6fb0b7bd3bff1991e77f0cd7db48 --- /dev/null +++ b/deploy/helm/templates/servicemonitor.yaml @@ -0,0 +1,34 @@ +{{- if .Values.service_monitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "rustus.fullname" . }}-monitor + labels: + {{- include "rustus.labels" . | nindent 4 }} + {{- if .Values.service_monitor.additionalLabels }} + {{- .Values.service_monitor.additionalLabels | toYaml | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: http + {{- if .Values.service_monitor.interval }} + interval: {{ .Values.service_monitor.interval }} + {{- end }} + {{- if .Values.service_monitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.service_monitor.scrapeTimeout }} + {{- end }} + {{- if .Values.service_monitor.honorLabels }} + honorLabels: {{ .Values.service_monitor.honorLabels }} + {{- end }} + {{- if .Values.service_monitor.relabellings }} + relabelings: {{- toYaml .Values.service_monitor.relabellings | nindent 6 }} + {{- end }} + {{- if .Values.service_monitor.metricRelabelings }} + metricRelabelings: {{- toYaml .Values.service_monitor.metricRelabelings | nindent 6 }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: {{- include "rustus.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index a062c48f8467c8e97f5085561e5bebc78aefffb7..643881640a5374b9fe625350c403b28e3ce26c33 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -178,3 +178,17 @@ mysql: database: rustus username: rustus password: rustus + + +# Configuration for prometheus operator's ServiceMonitor. +# You can read more about operator and custom resources +# here: https://operatorhub.io/operator/prometheus +service_monitor: + enabled: false + + additionalLabels: {} + interval: 5s + scrapeTimeout: "" + honorLabels: "" + relabellings: {} + metricRelabelings: {} \ No newline at end of file