Skip to content

Commit

Permalink
Cld 6825 push proxy chart service monitor improvements (#441)
Browse files Browse the repository at this point in the history
* [feat] push-proxies Introducing ServiceMonitor

Introducing ServiceMonitor resource values and templating

Ticket: https://mattermost.atlassian.net/browse/CLD-6825
Signed-off-by: phoinixgrr <[email protected]>

* [chore] Bumping push-proxy helm chart

---------

Signed-off-by: phoinixgrr <[email protected]>
  • Loading branch information
phoinixgrr authored Feb 6, 2024
1 parent 3245526 commit bbc71f0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/mattermost-push-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions charts/mattermost-push-proxy/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
21 changes: 21 additions & 0 deletions charts/mattermost-push-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bbc71f0

Please sign in to comment.