From 5929ef28620ad8a902e2d9f8233b3c2c8386f870 Mon Sep 17 00:00:00 2001 From: Jimi Dodd-o Date: Thu, 15 Aug 2024 13:17:49 -0400 Subject: [PATCH] chore/Enable csrf in helm chart for prometheus exporter (#372) Enable csrf in helm chart for prometheus exporter --- charts/prefect-agent/README.md | 2 +- charts/prefect-server/README.md | 2 +- charts/prefect-worker/README.md | 2 +- charts/prometheus-prefect-exporter/README.md | 3 ++- charts/prometheus-prefect-exporter/templates/deployment.yaml | 4 ++++ charts/prometheus-prefect-exporter/values.schema.json | 5 +++++ charts/prometheus-prefect-exporter/values.yaml | 3 +++ 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/charts/prefect-agent/README.md b/charts/prefect-agent/README.md index 1f2db926..90afdac7 100644 --- a/charts/prefect-agent/README.md +++ b/charts/prefect-agent/README.md @@ -83,4 +83,4 @@ Prefect Agent application bundle | serviceAccount.name | string | `""` | the name of the ServiceAccount to use. if not set and create is true, a name is generated using the common.names.fullname template | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/prefect-server/README.md b/charts/prefect-server/README.md index 703c8a4b..fddf0ec7 100644 --- a/charts/prefect-server/README.md +++ b/charts/prefect-server/README.md @@ -228,4 +228,4 @@ prefect-server: | serviceAccount.name | string | `""` | the name of the ServiceAccount to use. if not set and create is true, a name is generated using the common.names.fullname template | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/prefect-worker/README.md b/charts/prefect-worker/README.md index 2d29a9de..1e7878e8 100644 --- a/charts/prefect-worker/README.md +++ b/charts/prefect-worker/README.md @@ -326,4 +326,4 @@ Please note that configuring the template via `baseJobTemplate.existingConfigMap | worker.tolerations | list | `[]` | tolerations for worker pods assignment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/prometheus-prefect-exporter/README.md b/charts/prometheus-prefect-exporter/README.md index 192d23af..e507bd9b 100644 --- a/charts/prometheus-prefect-exporter/README.md +++ b/charts/prometheus-prefect-exporter/README.md @@ -62,6 +62,7 @@ Shoutout to @ialejandro for the original work on this chart! |-----|------|---------|-------------| | affinity | object | `{}` | Affinity for pod assignment | | autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling with CPU or memory utilization percentage | +| csrfAuth | bool | `false` | Enable CSRF authentication (Only set to true if Prefect Server has CSRF enabled) | | env | object | `{}` | Environment variables to configure application | | fullnameOverride | string | `""` | String to fully override common.names.fullname template | | image | object | `{"pullPolicy":"IfNotPresent","repository":"prefecthq/prometheus-prefect-exporter","tag":"1.1.0"}` | Image registry | @@ -91,4 +92,4 @@ Shoutout to @ialejandro for the original work on this chart! | tolerations | list | `[]` | Tolerations for pod assignment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/prometheus-prefect-exporter/templates/deployment.yaml b/charts/prometheus-prefect-exporter/templates/deployment.yaml index cd49057d..090ec143 100644 --- a/charts/prometheus-prefect-exporter/templates/deployment.yaml +++ b/charts/prometheus-prefect-exporter/templates/deployment.yaml @@ -63,6 +63,10 @@ spec: env: - name: PREFECT_API_URL value: {{ .Values.prefectApiUrl }} + {{- if .Values.csrfAuth }} + - name: PREFECT_CSRF_ENABLED + value: "True" + {{- end }} {{- if .Values.env }} {{- range $key, $value := .Values.env }} - name: {{ $key | upper }} diff --git a/charts/prometheus-prefect-exporter/values.schema.json b/charts/prometheus-prefect-exporter/values.schema.json index e3ccc553..0102031b 100644 --- a/charts/prometheus-prefect-exporter/values.schema.json +++ b/charts/prometheus-prefect-exporter/values.schema.json @@ -72,6 +72,11 @@ "title": "Prefect API URL", "description": "Prefect API URL" }, + "csrfAuth": { + "type": "boolean", + "title": "CSRF Auth", + "description": "Enable CSRF auth" + }, "env": { "type": "object", "title": "Environment Variables", diff --git a/charts/prometheus-prefect-exporter/values.yaml b/charts/prometheus-prefect-exporter/values.yaml index c854566a..c4f49d1f 100644 --- a/charts/prometheus-prefect-exporter/values.yaml +++ b/charts/prometheus-prefect-exporter/values.yaml @@ -29,6 +29,9 @@ serviceAccount: # -- Prefect API URL to connect to for metrics prefectApiUrl: http://prefect-server.prefect.svc.cluster.local:4200/api + +# -- Enable CSRF authentication (Only set to true if Prefect Server has CSRF enabled) +csrfAuth: false # -- Environment variables to configure application env: {} # Plain vars