diff --git a/charts/mattermost-push-proxy/Chart.yaml b/charts/mattermost-push-proxy/Chart.yaml index fc394e51..b26b8601 100644 --- a/charts/mattermost-push-proxy/Chart.yaml +++ b/charts/mattermost-push-proxy/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: Mattermost Push Proxy server name: mattermost-push-proxy type: application -version: 0.10.4 +version: 0.10.5 appVersion: 5.28.0 keywords: - mattermost diff --git a/charts/mattermost-push-proxy/templates/service-monitor.yaml b/charts/mattermost-push-proxy/templates/service-monitor.yaml new file mode 100644 index 00000000..76fc6919 --- /dev/null +++ b/charts/mattermost-push-proxy/templates/service-monitor.yaml @@ -0,0 +1,43 @@ +{{- if .Values.metrics.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "mattermost-push-proxy.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ include "mattermost-push-proxy.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "mattermost-push-proxy.chart" . }} + {{- with .Values.metrics.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: {{ .Values.service.name }} + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval | quote }} + {{- end }} + {{- with .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + path: {{ .Values.metrics.serviceMonitor.path | quote }} + {{- with .Values.metrics.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout | quote }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.jobLabel }} + jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace | quote }} + selector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "mattermost-push-proxy.name" . }} +{{- end }} diff --git a/charts/mattermost-push-proxy/values.yaml b/charts/mattermost-push-proxy/values.yaml index 02956d91..2170073e 100644 --- a/charts/mattermost-push-proxy/values.yaml +++ b/charts/mattermost-push-proxy/values.yaml @@ -67,8 +67,29 @@ ingress: # You cannot specify both the authKey and privateCert methods. sendTimeoutSec: 30 +# To be phased out in favor of servicemonitors.monitoring.coreos.com enableMetrics: true +metrics: + enabled: false + serviceMonitor: + # -- Additional labels that can be used so ServiceMonitor will be discovered by Prometheus + additionalLabels: {} + # -- Interval at which metrics should be scraped. + interval: "30s" + # -- The name of the label on the target service to use as the job name in Prometheus + jobLabel: "" + # -- MetricRelabelConfigs to apply to samples before ingestion + metricRelabelings: {} + # -- Namespace for the ServiceMonitor Resource (defaults to the Release Namespace) + namespace: "" + # -- The path used by Prometheus to scrape metrics + path: "/metrics" + # -- RelabelConfigs to apply to samples before scraping + relabelings: {} + # -- Timeout after which the scrape is ended + scrapeTimeout: "" + applePushSettings: authKey: "" authKeyFile: "/mattermost-push-proxy/config/AuthKey_1234.p8"