From 85d4fd42f02b29797fcc43033be44278dabceab6 Mon Sep 17 00:00:00 2001 From: beilin-upstream Date: Wed, 31 Jan 2024 10:57:01 +0200 Subject: [PATCH 1/3] add role and rolebinding create configuration --- charts/prefect-worker/templates/role.yaml | 2 ++ .../prefect-worker/templates/rolebinding.yaml | 2 ++ charts/prefect-worker/values.schema.json | 21 +++++++++++++++++++ charts/prefect-worker/values.yaml | 7 +++++++ 4 files changed, 32 insertions(+) diff --git a/charts/prefect-worker/templates/role.yaml b/charts/prefect-worker/templates/role.yaml index 9cc811d6..93651b08 100644 --- a/charts/prefect-worker/templates/role.yaml +++ b/charts/prefect-worker/templates/role.yaml @@ -1,3 +1,4 @@ +{{- if .Values.role.create }} apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} kind: Role metadata: @@ -22,3 +23,4 @@ rules: {{- if .Values.role.extraPermissions }} {{- include "common.tplvalues.render" (dict "value" .Values.role.extraPermissions "context" $) | nindent 0 }} {{- end }} +{{- end }} diff --git a/charts/prefect-worker/templates/rolebinding.yaml b/charts/prefect-worker/templates/rolebinding.yaml index f2c602c7..26c4066b 100644 --- a/charts/prefect-worker/templates/rolebinding.yaml +++ b/charts/prefect-worker/templates/rolebinding.yaml @@ -1,3 +1,4 @@ +{{- if .Values.rolebinding.create }} apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} kind: RoleBinding metadata: @@ -20,3 +21,4 @@ subjects: - kind: ServiceAccount name: {{ template "worker.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} +{{- end }} diff --git a/charts/prefect-worker/values.schema.json b/charts/prefect-worker/values.schema.json index eacf119f..988ee573 100644 --- a/charts/prefect-worker/values.schema.json +++ b/charts/prefect-worker/values.schema.json @@ -590,6 +590,12 @@ "form": true, "additionalProperties": false, "properties": { + "create": { + "type": "boolean", + "title": "Create", + "description": "create role", + "form": true + }, "extraPermissions": { "type": "array", "title": "Extra Permissions", @@ -598,6 +604,21 @@ } } }, + "rolebinding": { + "type": "object", + "title": "RoleBinding", + "description": "rolebinding configuration", + "form": true, + "additionalProperties": false, + "properties": { + "create": { + "type": "boolean", + "title": "Create", + "description": "create role binding", + "form": true + } + } + }, "common": { "type": "object", "title": "Common", diff --git a/charts/prefect-worker/values.yaml b/charts/prefect-worker/values.yaml index cd58a670..95e207b7 100644 --- a/charts/prefect-worker/values.yaml +++ b/charts/prefect-worker/values.yaml @@ -215,6 +215,8 @@ serviceAccount: ## Role configuration role: + # -- specifies whether a Role should be created + create: true ## List of extra role permissions ## e.g: ## extraPermissions: @@ -223,3 +225,8 @@ role: ## verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] # -- array with extra permissions to add to the worker role extraPermissions: [] + +## RoleBinding configuration +rolebinding: + # -- specifies whether a RoleBinding should be created + create: true From 617c5501202887c1b6774de0ae816494656483de Mon Sep 17 00:00:00 2001 From: beilin-upstream Date: Wed, 31 Jan 2024 11:05:45 +0200 Subject: [PATCH 2/3] linting --- charts/prefect-worker/templates/configmap.yaml | 1 - .../templates/tests/test-connection.yaml | 2 +- charts/prometheus-prefect-exporter/values.schema.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/prefect-worker/templates/configmap.yaml b/charts/prefect-worker/templates/configmap.yaml index 355fc61a..d78f5ca5 100644 --- a/charts/prefect-worker/templates/configmap.yaml +++ b/charts/prefect-worker/templates/configmap.yaml @@ -12,4 +12,3 @@ metadata: data: baseJobTemplate.json: {{ .Values.worker.config.baseJobTemplate | toJson }} {{- end }} - diff --git a/charts/prometheus-prefect-exporter/templates/tests/test-connection.yaml b/charts/prometheus-prefect-exporter/templates/tests/test-connection.yaml index e3d2a407..e4169f95 100644 --- a/charts/prometheus-prefect-exporter/templates/tests/test-connection.yaml +++ b/charts/prometheus-prefect-exporter/templates/tests/test-connection.yaml @@ -14,4 +14,4 @@ spec: command: ['wget'] args: ['{{ include "prometheus-prefect-exporter.fullname" . }}:{{ .Values.service.targetPort | default .Values.service.port }}'] restartPolicy: Never -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/prometheus-prefect-exporter/values.schema.json b/charts/prometheus-prefect-exporter/values.schema.json index e688d382..475cf6bd 100644 --- a/charts/prometheus-prefect-exporter/values.schema.json +++ b/charts/prometheus-prefect-exporter/values.schema.json @@ -313,4 +313,4 @@ "form": true } } -} \ No newline at end of file +} From 0c5ff3d6da2661df0d0e2ac1161307a2531a8345 Mon Sep 17 00:00:00 2001 From: beilin-upstream Date: Wed, 31 Jan 2024 11:15:30 +0200 Subject: [PATCH 3/3] helm docs --- charts/prefect-agent/README.md | 2 +- charts/prefect-server/README.md | 2 +- charts/prefect-worker/README.md | 4 +++- charts/prometheus-prefect-exporter/README.md | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/prefect-agent/README.md b/charts/prefect-agent/README.md index 7f4c4ffc..9c1c3e9b 100644 --- a/charts/prefect-agent/README.md +++ b/charts/prefect-agent/README.md @@ -81,4 +81,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.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/prefect-server/README.md b/charts/prefect-server/README.md index 17b3d865..ec0cbc3d 100644 --- a/charts/prefect-server/README.md +++ b/charts/prefect-server/README.md @@ -197,4 +197,4 @@ No secrets are created when providing an existing secret. | 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.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/prefect-worker/README.md b/charts/prefect-worker/README.md index 7a35505b..8dd06d94 100644 --- a/charts/prefect-worker/README.md +++ b/charts/prefect-worker/README.md @@ -236,7 +236,9 @@ helm install prefect-worker prefect/prefect-worker -f values.yaml --set-file wor | fullnameOverride | string | `"prefect-worker"` | fully override common.names.fullname | | nameOverride | string | `""` | partially overrides common.names.name | | namespaceOverride | string | `""` | fully override common.names.namespace | +| role.create | bool | `true` | specifies whether a Role should be created | | role.extraPermissions | list | `[]` | array with extra permissions to add to the worker role | +| rolebinding.create | bool | `true` | specifies whether a RoleBinding should be created | | serviceAccount.annotations | object | `{}` | additional service account annotations (evaluated as a template) | | serviceAccount.create | bool | `true` | specifies whether a ServiceAccount should be created | | 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 | @@ -301,4 +303,4 @@ helm install prefect-worker prefect/prefect-worker -f values.yaml --set-file wor | worker.tolerations | list | `[]` | tolerations for worker pods assignment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/prometheus-prefect-exporter/README.md b/charts/prometheus-prefect-exporter/README.md index 23068095..ac5e1182 100644 --- a/charts/prometheus-prefect-exporter/README.md +++ b/charts/prometheus-prefect-exporter/README.md @@ -84,4 +84,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.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)