Skip to content

Commit

Permalink
Added permissions for leader election (#1647)
Browse files Browse the repository at this point in the history
Added new RBAC permissions needed by default for leader election for the coordination/v1 API.
Required after upgrade to golang:1.19.2.
In k8s.io/[email protected]/tools/leaderelection/resourcelock/interface.go:166 `configMapsResourceLock` was removed and should be replaced by `ConfigMapsLeasesResourceLock`.
  • Loading branch information
ordukhanian authored Mar 17, 2023
1 parent a733749 commit bd2eda2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.1.26
version: 1.1.27
appVersion: v1beta2-1.3.8-3.1.1
keywords:
- spark
Expand Down
20 changes: 19 additions & 1 deletion charts/spark-operator-chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,25 @@ rules:
verbs:
- delete
{{- end }}

{{- if gt (int .Values.replicaCount) 1 }}
- apiGroups:
- coordination.k8s.io
resources:
- leases
resourceNames:
- {{ .Values.leaderElection.lockName }}
verbs:
- get
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
{{- end }}
---

apiVersion: rbac.authorization.k8s.io/v1
Expand Down

0 comments on commit bd2eda2

Please sign in to comment.