From e4120c2a78a216695cf4726f6f708b2e8908a21e Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Fri, 12 Jul 2024 15:56:45 +0200 Subject: [PATCH 1/2] add servicemonitor --- standard-app/example.values.yaml | 4 ++++ .../templates/network/servicemonitor.yaml | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 standard-app/templates/network/servicemonitor.yaml diff --git a/standard-app/example.values.yaml b/standard-app/example.values.yaml index 8a31b91..7cf97f2 100644 --- a/standard-app/example.values.yaml +++ b/standard-app/example.values.yaml @@ -106,6 +106,10 @@ apps: - secretKey: appsettings.json property: APPSETTINGS_JSON - secretKey: SOURCE_PROJECT_ID + serviceMonitor: + interval: 60s # default 30s + port: metrics + scrapeTimeout: 10s # default 30s example-app-2: diff --git a/standard-app/templates/network/servicemonitor.yaml b/standard-app/templates/network/servicemonitor.yaml new file mode 100644 index 0000000..64ea30a --- /dev/null +++ b/standard-app/templates/network/servicemonitor.yaml @@ -0,0 +1,19 @@ +{{ range $appName, $appConfig := .Values.apps }} +{{ with $appConfig.serviceMonitor }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ $appName }} +spec: + endpoints: + - interval: {{ .interval | default "30s"}} + port: {{ .port }} + scrapeTimeout: {{ .scrapeTimeout | default "30s"}} + namespaceSelector: + matchNames: + - {{ $appName }} + selector: + matchLabels: + app: {{ $appName }} +{{- end }} +{{- end }} \ No newline at end of file From 2ac85be9a3c8b142a0110a2853160c93b49a2c58 Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Fri, 12 Jul 2024 17:34:44 +0200 Subject: [PATCH 2/2] bump version --- standard-app/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-app/Chart.yaml b/standard-app/Chart.yaml index 59b4540..e70eead 100644 --- a/standard-app/Chart.yaml +++ b/standard-app/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: standard-app description: A Helm chart library by Cloudkite type: application -version: 0.4.5 +version: 0.4.6 maintainters: - email: hello@cloudkite.io name: cloudkite