Skip to content

Commit

Permalink
Merge pull request #37 from cloudkite-io/add-service-monitor
Browse files Browse the repository at this point in the history
add servicemonitor
  • Loading branch information
kirill-cloudkite authored Jul 12, 2024
2 parents 88e890c + 2ac85be commit 1487f53
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion standard-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
name: cloudkite
4 changes: 4 additions & 0 deletions standard-app/example.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions standard-app/templates/network/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 1487f53

Please sign in to comment.