feat: add monitoring to argocd-notifications
This commit is contained in:
parent
cb926a8fac
commit
a68229e978
5 changed files with 88 additions and 0 deletions
|
@ -43,6 +43,19 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common metrics labels
|
||||||
|
*/}}
|
||||||
|
{{- define "argocd-notifications.metrics.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "argocd-notifications.chart" . }}
|
||||||
|
{{ include "argocd-notifications.metrics.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Common slack bot labels
|
Common slack bot labels
|
||||||
*/}}
|
*/}}
|
||||||
|
@ -63,6 +76,14 @@ app.kubernetes.io/name: {{ include "argocd-notifications.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector metrics labels
|
||||||
|
*/}}
|
||||||
|
{{- define "argocd-notifications.metrics.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "argocd-notifications.name" . }}-metrics
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Selector slack bot labels
|
Selector slack bot labels
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -29,6 +29,16 @@ spec:
|
||||||
command:
|
command:
|
||||||
- /app/argocd-notifications
|
- /app/argocd-notifications
|
||||||
- controller
|
- controller
|
||||||
|
- --loglevel={{ .Values.logLevel }}
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- --metrics-port={{ .Values.metrics.port }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
- containerPort: {{ .Values.metrics.port }}
|
||||||
|
name: metrics
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
|
15
charts/argocd-notifications/templates/service-metrics.yaml
Normal file
15
charts/argocd-notifications/templates/service-metrics.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{{- if .Values.metrics.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "argocd-notifications.name" . }}-metrics
|
||||||
|
labels:
|
||||||
|
{{- include "argocd-notifications.metrics.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
{{- include "argocd-notifications.selectorLabels" . | nindent 4 }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.metrics.port }}
|
||||||
|
targetPort: {{ .Values.metrics.port }}
|
||||||
|
{{- end }}
|
30
charts/argocd-notifications/templates/servicemonitor.yaml
Normal file
30
charts/argocd-notifications/templates/servicemonitor.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: {{ include "argocd-notifications.name" . }}-metrics
|
||||||
|
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "argocd-notifications.metrics.labels" . | nindent 4 }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
|
||||||
|
{{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
|
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||||
|
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||||
|
{{- end }}
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- {{ .Release.Namespace }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "argocd-notifications.metrics.selectorLabels" . | nindent 6 }}
|
||||||
|
{{- end }}
|
|
@ -87,6 +87,18 @@ secret:
|
||||||
# email address in from field
|
# email address in from field
|
||||||
from:
|
from:
|
||||||
|
|
||||||
|
logLevel: info
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
port: 9001
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: false
|
||||||
|
additionalLabels: {}
|
||||||
|
# namespace: monitoring
|
||||||
|
# interval: 30s
|
||||||
|
# scrapeTimeout: 10s
|
||||||
|
|
||||||
resources: {}
|
resources: {}
|
||||||
# limits:
|
# limits:
|
||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
|
|
Loading…
Reference in a new issue