From fd8b9ca319f0ad6dffb39ea9595eefbfd4c1247c Mon Sep 17 00:00:00 2001 From: Zaggy21 Date: Thu, 26 Feb 2026 16:24:59 +0100 Subject: [PATCH] add metrics Service and ServiceMonitor to shoot-grafter chart On-behalf-of: @SAP krzysztof.zagorski@sap.com --- shoot-grafter/charts/templates/metrics.yaml | 47 +++++++++++++++++++++ shoot-grafter/charts/values.yaml | 5 +++ 2 files changed, 52 insertions(+) create mode 100644 shoot-grafter/charts/templates/metrics.yaml diff --git a/shoot-grafter/charts/templates/metrics.yaml b/shoot-grafter/charts/templates/metrics.yaml new file mode 100644 index 000000000..26f2432c6 --- /dev/null +++ b/shoot-grafter/charts/templates/metrics.yaml @@ -0,0 +1,47 @@ +{{/* +SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Greenhouse contributors +SPDX-License-Identifier: Apache-2.0 +*/}} + +--- +apiVersion: v1 +kind: Service +metadata: + name: shoot-grafter-metrics + namespace: {{ .Release.Namespace }} + labels: + app: shoot-grafter +spec: + type: ClusterIP + selector: + app: shoot-grafter + ports: + - name: metrics + port: 8080 + targetPort: 8080 + protocol: TCP + +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: shoot-grafter + namespace: {{ .Release.Namespace }} + labels: + app: shoot-grafter + {{- with .Values.monitoring.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + endpoints: + - honorLabels: true + interval: 30s + port: metrics + scheme: http + path: /metrics + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + app: shoot-grafter \ No newline at end of file diff --git a/shoot-grafter/charts/values.yaml b/shoot-grafter/charts/values.yaml index e90d32e05..5e63b605c 100644 --- a/shoot-grafter/charts/values.yaml +++ b/shoot-grafter/charts/values.yaml @@ -2,7 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 replicaCount: 1 + image: registry: ghcr.io/cloudoperators repository: shoot-grafter pullPolicy: IfNotPresent + +monitoring: + labels: + plugin: kube-monitoring