From 925f817e42da58d02d1d6e56fc2424b45771868a Mon Sep 17 00:00:00 2001 From: Ankit Chawla Date: Wed, 4 May 2022 16:22:30 +0530 Subject: [PATCH] Added service monitors for components whose metrics are exposed (#2424) --- .../templates/controller/servicemonitor.yaml | 18 ++++++++++++++++++ .../templates/executor/servicemonitor.yaml | 18 ++++++++++++++++++ .../templates/router/servicemonitor.yaml | 18 ++++++++++++++++++ .../templates/storagesvc/servicemonitor.yaml | 18 ++++++++++++++++++ charts/fission-all/values.yaml | 6 ++++++ 5 files changed, 78 insertions(+) create mode 100644 charts/fission-all/templates/controller/servicemonitor.yaml create mode 100644 charts/fission-all/templates/executor/servicemonitor.yaml create mode 100644 charts/fission-all/templates/router/servicemonitor.yaml create mode 100644 charts/fission-all/templates/storagesvc/servicemonitor.yaml diff --git a/charts/fission-all/templates/controller/servicemonitor.yaml b/charts/fission-all/templates/controller/servicemonitor.yaml new file mode 100644 index 00000000..e4c68ccf --- /dev/null +++ b/charts/fission-all/templates/controller/servicemonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: controller-monitor + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + svc: controller + endpoints: + - targetPort: 8080 +{{- end -}} \ No newline at end of file diff --git a/charts/fission-all/templates/executor/servicemonitor.yaml b/charts/fission-all/templates/executor/servicemonitor.yaml new file mode 100644 index 00000000..0a9ba668 --- /dev/null +++ b/charts/fission-all/templates/executor/servicemonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: executor-monitor + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + svc: executor + endpoints: + - targetPort: 8080 +{{- end -}} \ No newline at end of file diff --git a/charts/fission-all/templates/router/servicemonitor.yaml b/charts/fission-all/templates/router/servicemonitor.yaml new file mode 100644 index 00000000..7f1b4c61 --- /dev/null +++ b/charts/fission-all/templates/router/servicemonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: router-monitor + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + svc: router + endpoints: + - targetPort: 8080 +{{- end -}} \ No newline at end of file diff --git a/charts/fission-all/templates/storagesvc/servicemonitor.yaml b/charts/fission-all/templates/storagesvc/servicemonitor.yaml new file mode 100644 index 00000000..808f3855 --- /dev/null +++ b/charts/fission-all/templates/storagesvc/servicemonitor.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: storagesvc-monitor + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + svc: storagesvc + endpoints: + - targetPort: 8080 +{{- end -}} \ No newline at end of file diff --git a/charts/fission-all/values.yaml b/charts/fission-all/values.yaml index fd7a9344..83f32329 100644 --- a/charts/fission-all/values.yaml +++ b/charts/fission-all/values.yaml @@ -362,6 +362,12 @@ kafka: ## # version: "0.11.2.0" +serviceMonitor: + enabled: false + ##namespace in which you want to deploy servicemonitor + ## + namespace: "" + ## Persist data to a persistent volume. ## persistence: