-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grant spark-operator write access for the required apigroup Update aissemble-spark-operator-chart README to reflect the rbac.yaml change Add template comment for the custom rbac.yaml file notifying why the change is required
- Loading branch information
1 parent
a257495
commit 44d816c
Showing
3 changed files
with
175 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
extensions/extensions-helm/aissemble-spark-operator-chart/templates/rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{{- /* | ||
aiSSEMBLE Custom rbac.yaml | ||
|
||
Required custom rbac.yaml file that grants the sparkoperator service account | ||
create, delete, and update access to the apigroup apiextensions.k8s.io. | ||
|
||
This is necessary for the pipeline-invocation-service to create instances of the | ||
SparkApplication CRD to submit pipelines to the Spark Operator for execution. | ||
*/}} | ||
|
||
{{- if or .Values.rbac.create .Values.rbac.createClusterRole }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "spark-operator.fullname" (index .Subcharts "spark-operator") }} | ||
annotations: | ||
"helm.sh/hook": pre-install, pre-upgrade | ||
"helm.sh/hook-delete-policy": hook-failed, before-hook-creation | ||
"helm.sh/hook-weight": "-10" | ||
labels: | ||
{{- include "spark-operator.labels" (index .Subcharts "spark-operator") | nindent 4 }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- create | ||
- get | ||
- delete | ||
- update | ||
- list | ||
- apiGroups: | ||
- extensions | ||
- networking.k8s.io | ||
resources: | ||
- ingresses | ||
verbs: | ||
- create | ||
- get | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- update | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- resourcequotas | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- create | ||
- get | ||
- update | ||
- delete | ||
- apiGroups: | ||
- admissionregistration.k8s.io | ||
resources: | ||
- mutatingwebhookconfigurations | ||
- validatingwebhookconfigurations | ||
verbs: | ||
- create | ||
- get | ||
- update | ||
- delete | ||
- apiGroups: | ||
- sparkoperator.k8s.io | ||
resources: | ||
- sparkapplications | ||
- sparkapplications/status | ||
- scheduledsparkapplications | ||
- scheduledsparkapplications/status | ||
verbs: | ||
- "*" | ||
{{- if .Values.batchScheduler.enable }} | ||
# required for the `volcano` batch scheduler | ||
- apiGroups: | ||
- scheduling.incubator.k8s.io | ||
- scheduling.sigs.dev | ||
- scheduling.volcano.sh | ||
resources: | ||
- podgroups | ||
verbs: | ||
- "*" | ||
{{- end }} | ||
{{ if .Values.webhook.enable }} | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- jobs | ||
verbs: | ||
- delete | ||
{{- end }} | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "spark-operator.fullname" (index .Subcharts "spark-operator") }} | ||
annotations: | ||
"helm.sh/hook": pre-install, pre-upgrade | ||
"helm.sh/hook-delete-policy": hook-failed, before-hook-creation | ||
"helm.sh/hook-weight": "-10" | ||
labels: | ||
{{- include "spark-operator.labels" (index .Subcharts "spark-operator") | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "spark-operator.serviceAccountName" (index .Subcharts "spark-operator") }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ include "spark-operator.fullname" (index .Subcharts "spark-operator") }} | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters