From 38f3bc38ce8c9b88f163ea719f033e7b26dc03f1 Mon Sep 17 00:00:00 2001 From: Kevin Heise Date: Mon, 13 Nov 2023 14:01:08 +0100 Subject: [PATCH 1/3] add servicemonitor --- charts/gdscan/Chart.yaml | 2 +- charts/gdscan/templates/servicemonitor.yaml | 17 +++++++++++++++++ charts/gdscan/values.yaml | 12 ++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 charts/gdscan/templates/servicemonitor.yaml diff --git a/charts/gdscan/Chart.yaml b/charts/gdscan/Chart.yaml index f5336e5..6adb33d 100644 --- a/charts/gdscan/Chart.yaml +++ b/charts/gdscan/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - name: G DATA CyberDefense AG email: oem@gdata.de type: application -version: 1.2.0 +version: 1.3.0 diff --git a/charts/gdscan/templates/servicemonitor.yaml b/charts/gdscan/templates/servicemonitor.yaml new file mode 100644 index 0000000..47a8228 --- /dev/null +++ b/charts/gdscan/templates/servicemonitor.yaml @@ -0,0 +1,17 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "gdscan.fullname" . }} + labels: + {{- include "gdscan.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "gdscan.selectorLabels" . | nindent 8 }} + endpoints: + - port: {{ .Values.metrics.servicemonitor.port }} + path: {{ .Values.metrics.servicemonitor.path }} + scheme: {{ .Values.metrics.servicemonitor.scheme | quote }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} diff --git a/charts/gdscan/values.yaml b/charts/gdscan/values.yaml index 8b69ae3..62c4658 100644 --- a/charts/gdscan/values.yaml +++ b/charts/gdscan/values.yaml @@ -5,13 +5,13 @@ server: image: repository: ghcr.io/gdatasoftwareag/scanserver pullPolicy: Always - tag: 1.7.2 + tag: 1.8.0 client: name: client image: repository: ghcr.io/gdatasoftwareag/scanclient pullPolicy: Always - tag: 1.7.2 + tag: 1.8.0 containerSecurityContext: enabled: false terminationGracePeriodSeconds: 30 @@ -31,6 +31,14 @@ service: type: "" port: 8080 +metrics: + servicemonitor: + enabled: false + port: 8080 + path: /metrics + scheme: http + + ingress: enabled: false className: "" From 699a028620813f8f33e415f04d72bdfcfe236e8a Mon Sep 17 00:00:00 2001 From: Kevin Heise Date: Mon, 13 Nov 2023 14:07:39 +0100 Subject: [PATCH 2/3] increase chart testing version --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c0d533..7692929 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,7 +35,7 @@ jobs: python-version: 3.7 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.0 - name: Run chart-testing (lint) run: ct lint --validate-maintainers=false --charts charts/gdscan From 9be88fbdc5e4907aceb67b7fba89c82ca333a685 Mon Sep 17 00:00:00 2001 From: Kevin Heise Date: Mon, 13 Nov 2023 14:13:21 +0100 Subject: [PATCH 3/3] add missing condition --- charts/gdscan/templates/servicemonitor.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/gdscan/templates/servicemonitor.yaml b/charts/gdscan/templates/servicemonitor.yaml index 47a8228..7038523 100644 --- a/charts/gdscan/templates/servicemonitor.yaml +++ b/charts/gdscan/templates/servicemonitor.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.servicemonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: @@ -15,3 +16,4 @@ spec: namespaceSelector: matchNames: - {{ .Release.Namespace }} +{{- end }} \ No newline at end of file