summaryrefslogtreecommitdiff
path: root/astroshop-platform/argocd-helmchart/templates/argocd-notifications
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-10-11 02:34:38 +0530
committerSaumit <justsaumit@protonmail.com>2025-10-11 02:34:38 +0530
commit88a326bacdffde9e065b08ba893a17149584e72e (patch)
tree20e380438497afb8c4b33a932505602590721690 /astroshop-platform/argocd-helmchart/templates/argocd-notifications
parentef773bd27019ec6597bd12237e3b4f4f0f46f244 (diff)
platform: Adding argocd helm chart
Diffstat (limited to 'astroshop-platform/argocd-helmchart/templates/argocd-notifications')
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrole.yaml52
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrolebinding.yaml16
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/deployment.yaml220
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/metrics.yaml35
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/networkpolicy.yaml20
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/pdb.yaml27
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/role.yaml45
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/rolebinding.yaml17
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/serviceaccount.yaml19
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-notifications/servicemonitor.yaml51
10 files changed, 502 insertions, 0 deletions
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrole.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrole.yaml
new file mode 100644
index 0000000..eba5973
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrole.yaml
@@ -0,0 +1,52 @@
+{{- if and .Values.notifications.enabled .Values.createClusterRoles }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: {{ include "argo-cd.notifications.fullname" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+rules:
+ {{- with .Values.notifications.clusterRoleRules.rules }}
+ {{- toYaml . | nindent 2 }}
+ {{- end }}
+ - apiGroups:
+ - argoproj.io
+ resources:
+ - applications
+ - appprojects
+ verbs:
+ - get
+ - list
+ - watch
+ - update
+ - patch
+ - apiGroups:
+ - ""
+ resources:
+ - configmaps
+ - secrets
+ verbs:
+ - list
+ - watch
+ {{- if (index .Values.configs.params "application.namespaces") }}
+ - create
+ {{- end }}
+ {{- if .Values.notifications.cm.create }}
+ - apiGroups:
+ - ""
+ resourceNames:
+ - argocd-notifications-cm
+ resources:
+ - configmaps
+ verbs:
+ - get
+ {{- end }}
+ - apiGroups:
+ - ""
+ resourceNames:
+ - {{ .Values.notifications.secret.name }}
+ resources:
+ - secrets
+ verbs:
+ - get
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrolebinding.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrolebinding.yaml
new file mode 100644
index 0000000..9a6fa7c
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/clusterrolebinding.yaml
@@ -0,0 +1,16 @@
+{{- if and .Values.notifications.enabled .Values.createClusterRoles }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: {{ include "argo-cd.notifications.fullname" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: {{ include "argo-cd.notifications.fullname" . }}
+subjects:
+- kind: ServiceAccount
+ name: {{ include "argo-cd.notifications.serviceAccountName" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/deployment.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/deployment.yaml
new file mode 100644
index 0000000..4467e65
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/deployment.yaml
@@ -0,0 +1,220 @@
+{{- if .Values.notifications.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ {{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.notifications.deploymentAnnotations) }}
+ annotations:
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+ name: {{ include "argo-cd.notifications.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+ {{- with (mergeOverwrite (deepCopy .Values.global.deploymentLabels) .Values.notifications.deploymentLabels) }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ replicas: 1
+ revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
+ {{- with include "argo-cd.strategy" (mergeOverwrite (deepCopy .Values.global.deploymentStrategy) .Values.notifications.deploymentStrategy) }}
+ strategy:
+ {{- trim . | nindent 4 }}
+ {{- end }}
+ selector:
+ matchLabels:
+ {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
+ template:
+ metadata:
+ {{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.notifications.podAnnotations) }}
+ annotations:
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 8 }}
+ {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.notifications.podLabels) }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- with .Values.notifications.runtimeClassName | default .Values.global.runtimeClassName }}
+ runtimeClassName: {{ . }}
+ {{- end }}
+ {{- with .Values.notifications.imagePullSecrets | default .Values.global.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.global.hostAliases }}
+ hostAliases:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.global.securityContext }}
+ securityContext:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.priorityClassName | default .Values.global.priorityClassName }}
+ priorityClassName: {{ . }}
+ {{- end }}
+ {{- if .Values.notifications.terminationGracePeriodSeconds }}
+ terminationGracePeriodSeconds: {{ .Values.notifications.terminationGracePeriodSeconds }}
+ {{- end }}
+ serviceAccountName: {{ include "argo-cd.notifications.serviceAccountName" . }}
+ automountServiceAccountToken: {{ .Values.notifications.automountServiceAccountToken }}
+ containers:
+ - name: {{ .Values.notifications.name }}
+ image: {{ default .Values.global.image.repository .Values.notifications.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.notifications.image.tag }}
+ imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.notifications.image.imagePullPolicy }}
+ args:
+ - /usr/local/bin/argocd-notifications
+ - --metrics-port={{ .Values.notifications.containerPorts.metrics }}
+ - --namespace={{ include "argo-cd.namespace" . }}
+ - --argocd-repo-server={{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}
+ - --secret-name={{ .Values.notifications.secret.name }}
+ {{- with .Values.notifications.logLevel }}
+ - --loglevel={{ . }}
+ {{- end }}
+ {{- with .Values.notifications.logFormat }}
+ - --logformat={{ . }}
+ {{- end }}
+ {{- range .Values.notifications.extraArgs }}
+ - {{ . | squote }}
+ {{- end }}
+ env:
+ {{- with (concat .Values.global.env .Values.notifications.extraEnv) }}
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGLEVEL
+ valueFrom:
+ configMapKeyRef:
+ key: notificationscontroller.log.level
+ name: argocd-cmd-params-cm
+ optional: true
+ - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGFORMAT
+ valueFrom:
+ configMapKeyRef:
+ key: notificationscontroller.log.format
+ name: argocd-cmd-params-cm
+ optional: true
+ - name: ARGOCD_LOG_FORMAT_TIMESTAMP
+ valueFrom:
+ configMapKeyRef:
+ name: argocd-cmd-params-cm
+ key: log.format.timestamp
+ optional: true
+ - name: ARGOCD_APPLICATION_NAMESPACES
+ valueFrom:
+ configMapKeyRef:
+ key: application.namespaces
+ name: argocd-cmd-params-cm
+ optional: true
+ - name: ARGOCD_NOTIFICATION_CONTROLLER_SELF_SERVICE_NOTIFICATION_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ key: notificationscontroller.selfservice.enabled
+ name: argocd-cmd-params-cm
+ optional: true
+ - name: ARGOCD_NOTIFICATION_CONTROLLER_REPO_SERVER_PLAINTEXT
+ valueFrom:
+ configMapKeyRef:
+ key: notificationscontroller.repo.server.plaintext
+ name: argocd-cmd-params-cm
+ optional: true
+ {{- with .Values.notifications.extraEnvFrom }}
+ envFrom:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ ports:
+ - name: metrics
+ containerPort: {{ .Values.notifications.containerPorts.metrics }}
+ protocol: TCP
+ {{- if .Values.notifications.livenessProbe.enabled }}
+ livenessProbe:
+ tcpSocket:
+ port: metrics
+ initialDelaySeconds: {{ .Values.notifications.livenessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.notifications.livenessProbe.periodSeconds }}
+ timeoutSeconds: {{ .Values.notifications.livenessProbe.timeoutSeconds }}
+ successThreshold: {{ .Values.notifications.livenessProbe.successThreshold }}
+ failureThreshold: {{ .Values.notifications.livenessProbe.failureThreshold }}
+ {{- end }}
+ {{- if .Values.notifications.readinessProbe.enabled }}
+ readinessProbe:
+ tcpSocket:
+ port: metrics
+ initialDelaySeconds: {{ .Values.notifications.readinessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.notifications.readinessProbe.periodSeconds }}
+ timeoutSeconds: {{ .Values.notifications.readinessProbe.timeoutSeconds }}
+ successThreshold: {{ .Values.notifications.readinessProbe.successThreshold }}
+ failureThreshold: {{ .Values.notifications.readinessProbe.failureThreshold }}
+ {{- end }}
+ resources:
+ {{- toYaml .Values.notifications.resources | nindent 12 }}
+ {{- with .Values.notifications.containerSecurityContext }}
+ securityContext:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ workingDir: /app
+ volumeMounts:
+ - name: tls-certs
+ mountPath: /app/config/tls
+ - name: argocd-repo-server-tls
+ mountPath: /app/config/reposerver/tls
+ {{- with .Values.notifications.extraVolumeMounts }}
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.notifications.extraContainers }}
+ {{- tpl (toYaml . ) $ | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.initContainers }}
+ initContainers:
+ {{- tpl (toYaml . ) $ | nindent 8 }}
+ {{- end }}
+ {{- with include "argo-cd.affinity" (dict "context" . "component" .Values.notifications) }}
+ affinity:
+ {{- trim . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.nodeSelector | default .Values.global.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.tolerations | default .Values.global.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }}
+ topologySpreadConstraints:
+ {{- range $constraint := . }}
+ - {{ toYaml $constraint | nindent 8 | trim }}
+ {{- if not $constraint.labelSelector }}
+ labelSelector:
+ matchLabels:
+ {{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.notifications.name) | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ volumes:
+ {{- with .Values.notifications.extraVolumes }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ - name: tls-certs
+ configMap:
+ name: argocd-tls-certs-cm
+ - name: argocd-repo-server-tls
+ secret:
+ secretName: argocd-repo-server-tls
+ optional: true
+ items:
+ - key: tls.crt
+ path: tls.crt
+ - key: tls.key
+ path: tls.key
+ - key: ca.crt
+ path: ca.crt
+ {{- with .Values.notifications.dnsConfig }}
+ dnsConfig:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ dnsPolicy: {{ .Values.notifications.dnsPolicy }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/metrics.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/metrics.yaml
new file mode 100644
index 0000000..9dd18c8
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/metrics.yaml
@@ -0,0 +1,35 @@
+{{- if and .Values.notifications.enabled .Values.notifications.metrics.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "argo-cd.notifications.fullname" . }}-metrics
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 4 }}
+ {{- with .Values.notifications.metrics.service.labels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- if or .Values.notifications.metrics.service.annotations .Values.global.addPrometheusAnnotations }}
+ annotations:
+ {{- if .Values.global.addPrometheusAnnotations }}
+ prometheus.io/port: {{ .Values.notifications.metrics.port | quote }}
+ prometheus.io/scrape: "true"
+ {{- end }}
+ {{- range $key, $value := .Values.notifications.metrics.service.annotations }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+spec:
+ type: {{ .Values.notifications.metrics.service.type }}
+ {{- if and .Values.notifications.metrics.service.clusterIP (eq .Values.notifications.metrics.service.type "ClusterIP") }}
+ clusterIP: {{ .Values.notifications.metrics.service.clusterIP }}
+ {{- end }}
+ {{- include "argo-cd.dualStack" . | indent 2 }}
+ selector:
+ {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
+ ports:
+ - name: {{ .Values.notifications.metrics.service.portName }}
+ protocol: TCP
+ port: {{ .Values.notifications.metrics.port }}
+ targetPort: metrics
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/networkpolicy.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/networkpolicy.yaml
new file mode 100644
index 0000000..1a5df53
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/networkpolicy.yaml
@@ -0,0 +1,20 @@
+{{- if and .Values.notifications.enabled (or .Values.notifications.networkPolicy.create .Values.global.networkPolicy.create) .Values.notifications.metrics.enabled }}
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+ name: {{ template "argo-cd.notifications.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+spec:
+ ingress:
+ - from:
+ - namespaceSelector: {}
+ ports:
+ - port: metrics
+ podSelector:
+ matchLabels:
+ {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
+ policyTypes:
+ - Ingress
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/pdb.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/pdb.yaml
new file mode 100644
index 0000000..4bdf211
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/pdb.yaml
@@ -0,0 +1,27 @@
+{{- if and .Values.notifications.enabled .Values.notifications.pdb.enabled }}
+apiVersion: policy/v1
+kind: PodDisruptionBudget
+metadata:
+ name: {{ include "argo-cd.notifications.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+ {{- with .Values.notifications.pdb.labels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- with .Values.notifications.pdb.annotations }}
+ annotations:
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+spec:
+ {{- with .Values.notifications.pdb.maxUnavailable }}
+ maxUnavailable: {{ . }}
+ {{- else }}
+ minAvailable: {{ .Values.notifications.pdb.minAvailable | default 0 }}
+ {{- end }}
+ selector:
+ matchLabels:
+ {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/role.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/role.yaml
new file mode 100644
index 0000000..800a937
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/role.yaml
@@ -0,0 +1,45 @@
+{{- if .Values.notifications.enabled }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: {{ template "argo-cd.notifications.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+rules:
+- apiGroups:
+ - argoproj.io
+ resources:
+ - applications
+ - appprojects
+ verbs:
+ - get
+ - list
+ - watch
+ - update
+ - patch
+- apiGroups:
+ - ""
+ resources:
+ - configmaps
+ - secrets
+ verbs:
+ - list
+ - watch
+- apiGroups:
+ - ""
+ resourceNames:
+ - argocd-notifications-cm
+ resources:
+ - configmaps
+ verbs:
+ - get
+- apiGroups:
+ - ""
+ resourceNames:
+ - {{ .Values.notifications.secret.name }}
+ resources:
+ - secrets
+ verbs:
+ - get
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/rolebinding.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/rolebinding.yaml
new file mode 100644
index 0000000..e225962
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/rolebinding.yaml
@@ -0,0 +1,17 @@
+{{- if .Values.notifications.enabled }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: {{ include "argo-cd.notifications.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ include "argo-cd.notifications.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "argo-cd.notifications.serviceAccountName" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/serviceaccount.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/serviceaccount.yaml
new file mode 100644
index 0000000..3da8f27
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/serviceaccount.yaml
@@ -0,0 +1,19 @@
+{{- if and .Values.notifications.enabled .Values.notifications.serviceAccount.create }}
+apiVersion: v1
+kind: ServiceAccount
+automountServiceAccountToken: {{ .Values.notifications.serviceAccount.automountServiceAccountToken }}
+metadata:
+ name: {{ include "argo-cd.notifications.serviceAccountName" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ {{- with .Values.notifications.serviceAccount.annotations }}
+ annotations:
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+ {{- with .Values.notifications.serviceAccount.labels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-notifications/servicemonitor.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/servicemonitor.yaml
new file mode 100644
index 0000000..22b882a
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-notifications/servicemonitor.yaml
@@ -0,0 +1,51 @@
+{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.notifications.enabled .Values.notifications.metrics.enabled .Values.notifications.metrics.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ name: {{ template "argo-cd.notifications.fullname" . }}
+ namespace: {{ default (include "argo-cd.namespace" .) .Values.notifications.metrics.serviceMonitor.namespace | quote }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
+ {{- with .Values.notifications.metrics.serviceMonitor.selector }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- if .Values.notifications.metrics.serviceMonitor.additionalLabels }}
+ {{- toYaml .Values.notifications.metrics.serviceMonitor.additionalLabels | nindent 4 }}
+ {{- end }}
+ {{- with .Values.notifications.metrics.serviceMonitor.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ endpoints:
+ - port: {{ .Values.notifications.metrics.service.portName }}
+ path: /metrics
+ {{- if .Values.notifications.metrics.serviceMonitor.interval }}
+ interval: {{ .Values.notifications.metrics.serviceMonitor.interval }}
+ {{- end }}
+ {{- if .Values.notifications.metrics.serviceMonitor.scrapeTimeout }}
+ scrapeTimeout: {{ .Values.notifications.metrics.serviceMonitor.scrapeTimeout }}
+ {{- end }}
+ {{- with .Values.notifications.metrics.serviceMonitor.scheme }}
+ scheme: {{ . }}
+ {{- end }}
+ {{- with .Values.notifications.metrics.serviceMonitor.tlsConfig }}
+ tlsConfig:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.metrics.serviceMonitor.relabelings }}
+ relabelings:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.notifications.metrics.serviceMonitor.metricRelabelings }}
+ metricRelabelings:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ honorLabels: {{ .Values.notifications.metrics.serviceMonitor.honorLabels }}
+ namespaceSelector:
+ matchNames:
+ - {{ include "argo-cd.namespace" . }}
+ selector:
+ matchLabels:
+ {{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 6 }}
+{{- end }}