From 4c1ee93faf780b93dd8909327dcdf6ada75901f4 Mon Sep 17 00:00:00 2001 From: mugi-o <62197019+mugioka@users.noreply.github.com> Date: Fri, 28 Jan 2022 22:44:46 +0900 Subject: [PATCH] feat(argo-workflows): argo workflows chart to allow set the namespace of Prometheus ServiceMonitor. (#1104) * feat(argo-workflows): argo workflows chart to allow set the namespace of Prometheus ServiceMonitor. Signed-off-by: mugioka * Bump minor chart version Signed-off-by: Marco Kilchhofer Co-authored-by: Marco Kilchhofer --- charts/argo-workflows/Chart.yaml | 4 ++-- charts/argo-workflows/README.md | 1 + .../controller/workflow-controller-servicemonitor.yaml | 3 +++ charts/argo-workflows/values.yaml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/argo-workflows/Chart.yaml b/charts/argo-workflows/Chart.yaml index 0b737f9d..cc96ad06 100644 --- a/charts/argo-workflows/Chart.yaml +++ b/charts/argo-workflows/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: argo-workflows description: A Helm chart for Argo Workflows type: application -version: 0.9.5 +version: 0.10.0 appVersion: v3.2.6 icon: https://raw.githubusercontent.com/argoproj/argo-workflows/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm @@ -15,4 +15,4 @@ maintainers: - name: benjaminws annotations: artifacthub.io/changes: | - - "[Changed]: Consistent .helmignore" + - "[Added]: Add controller serviceMonitor.namespace parameter." diff --git a/charts/argo-workflows/README.md b/charts/argo-workflows/README.md index 7a3ab5f7..f03ef190 100644 --- a/charts/argo-workflows/README.md +++ b/charts/argo-workflows/README.md @@ -110,6 +110,7 @@ Fields to note: | controller.serviceLabels | object | `{}` | Optional labels to add to the controller Service | | controller.serviceMonitor.additionalLabels | object | `{}` | Prometheus ServiceMonitor labels | | controller.serviceMonitor.enabled | bool | `false` | Enable a prometheus ServiceMonitor | +| controller.serviceMonitor.namespace | string | `""` | Prometheus ServiceMonitor namespace | | controller.serviceType | string | `"ClusterIP"` | Service type of the controller Service | | controller.telemetryConfig.enabled | bool | `false` | Enables prometheus telemetry server | | controller.telemetryConfig.path | string | `"/telemetry"` | telemetry path | diff --git a/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml b/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml index 54cf1b31..f71d3507 100644 --- a/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml +++ b/charts/argo-workflows/templates/controller/workflow-controller-servicemonitor.yaml @@ -3,6 +3,9 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "argo-workflows.controller.fullname" . }} + {{- with .Values.controller.serviceMonitor.namespace }} + namespace: {{ . }} + {{- end }} labels: {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} {{- with .Values.controller.serviceMonitor.additionalLabels }} diff --git a/charts/argo-workflows/values.yaml b/charts/argo-workflows/values.yaml index 8b727b67..2e07df47 100644 --- a/charts/argo-workflows/values.yaml +++ b/charts/argo-workflows/values.yaml @@ -145,6 +145,8 @@ controller: enabled: false # -- Prometheus ServiceMonitor labels additionalLabels: {} + # -- Prometheus ServiceMonitor namespace + namespace: "" # "monitoring" serviceAccount: # -- Create a service account for the controller create: true