Skip to content

Commit

Permalink
leader election rbac (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwq1990 authored Jan 25, 2022
1 parent e317eaa commit 250d215
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion config/charts/endpoints-operator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,34 @@ rules:
- clusterendpoints
- clusterendpoints/status
verbs:
- '*'
- '*'

---

# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "endpoints-operator.fullname" . }}-leader-election-role
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'

---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "endpoints-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ include "endpoints-operator.fullname" . }}-leader-election-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ include "endpoints-operator.fullname" . }}
namespace: {{ .Release.Namespace }}

0 comments on commit 250d215

Please sign in to comment.