Skip to content

Commit

Permalink
Merge pull request #1 from beilin-upstream/worker-options-control-rol…
Browse files Browse the repository at this point in the history
…e-and-role-binding

Worker options control role and role binding
  • Loading branch information
beilin-upstream authored Jan 31, 2024
2 parents f92575a + 0c5ff3d commit 85149fc
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/prefect-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion charts/prefect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion charts/prefect-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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)
1 change: 0 additions & 1 deletion charts/prefect-worker/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ metadata:
data:
baseJobTemplate.json: {{ .Values.worker.config.baseJobTemplate | toJson }}
{{- end }}

2 changes: 2 additions & 0 deletions charts/prefect-worker/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.role.create }}
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: Role
metadata:
Expand All @@ -22,3 +23,4 @@ rules:
{{- if .Values.role.extraPermissions }}
{{- include "common.tplvalues.render" (dict "value" .Values.role.extraPermissions "context" $) | nindent 0 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/prefect-worker/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rolebinding.create }}
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: RoleBinding
metadata:
Expand All @@ -20,3 +21,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "worker.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/prefect-worker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions charts/prefect-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion charts/prometheus-prefect-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
command: ['wget']
args: ['{{ include "prometheus-prefect-exporter.fullname" . }}:{{ .Values.service.targetPort | default .Values.service.port }}']
restartPolicy: Never
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/prometheus-prefect-exporter/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,4 @@
"form": true
}
}
}
}

0 comments on commit 85149fc

Please sign in to comment.