From 8cb2704682053a1ee0a7ae511c3a1150afac5912 Mon Sep 17 00:00:00 2001 From: Mate Ory Date: Thu, 10 Aug 2023 09:29:15 +0200 Subject: [PATCH] axosyslog-collector: add optional PodMonitor CR --- .../templates/podmonitor.yaml | 30 +++++++++++++++++++ charts/axosyslog-collector/values.yaml | 5 ++++ 2 files changed, 35 insertions(+) create mode 100644 charts/axosyslog-collector/templates/podmonitor.yaml diff --git a/charts/axosyslog-collector/templates/podmonitor.yaml b/charts/axosyslog-collector/templates/podmonitor.yaml new file mode 100644 index 0000000..7663042 --- /dev/null +++ b/charts/axosyslog-collector/templates/podmonitor.yaml @@ -0,0 +1,30 @@ +{{- if .Values.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ template "axosyslog-collector.fullname" . }} + namespace: {{ include "axosyslog-collector.namespace" . }} + labels: + app: "{{ template "axosyslog-collector.fullname" . }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + {{- with .Values.podMonitor.labels }} + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + {{- with .Values.podMonitor.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} +spec: + selector: + matchLabels: + app: "{{ template "axosyslog-collector.fullname" . }}" + release: {{ .Release.Name | quote }} + podMetricsEndpoints: + - port: exporter +{{- end }} diff --git a/charts/axosyslog-collector/values.yaml b/charts/axosyslog-collector/values.yaml index ec84192..f916bd0 100644 --- a/charts/axosyslog-collector/values.yaml +++ b/charts/axosyslog-collector/values.yaml @@ -32,6 +32,11 @@ metricsExporter: resources: {} securityContext: {} +podMonitor: + enabled: false # deploy the PodMonitor CR for Prometheus Operator (requires metricsExporter.enabled) + labels: {} + annotations: {} + config: raw: "" # Use this to manually set the contents of the syslog-ng.conf file. version: ""