Skip to content

Commit

Permalink
chore: Adjust RBAC with code (#585)
Browse files Browse the repository at this point in the history
* chore: Adjust RBAC with code

Signed-off-by: Jorge Turrado <[email protected]>

* fix typo

Signed-off-by: Jorge Turrado <[email protected]>

---------

Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer authored Dec 20, 2023
1 parent 0a0a48c commit 7e97aa4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
36 changes: 29 additions & 7 deletions keda/templates/manager/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ rules:
resources:
- configmaps
- configmaps/status
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- '*'
Expand Down Expand Up @@ -50,7 +57,11 @@ rules:
resources:
- '*/scale'
verbs:
- '*'
- get
- list
- patch
- update
- watch
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
- apiGroups:
- admissionregistration.k8s.io
Expand Down Expand Up @@ -93,12 +104,6 @@ rules:
- jobs
verbs:
- '*'
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
- apiGroups:
- eventing.keda.sh
resources:
Expand Down Expand Up @@ -160,6 +165,15 @@ rules:
- delete
- patch
- update
- apiGroups:
- eventing.keda.sh
resources:
- cloudeventsources
verbs:
- create
- delete
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -183,5 +197,13 @@ rules:
- get
- list
- watch
- apiGroups:
- eventing.keda.sh
resources:
- cloudeventsources
verbs:
- get
- list
- watch
{{- end -}}
{{- end -}}
8 changes: 7 additions & 1 deletion keda/templates/manager/role.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.rbac.create }}
{{- if or (and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled)) (.Values.permissions.operator.restrict.secret) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand All @@ -13,6 +12,13 @@ metadata:
name: {{ .Values.operator.name }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
{{- if or (and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled)) (.Values.permissions.operator.restrict.secret) }}
- apiGroups:
- ""
resources:
Expand Down

0 comments on commit 7e97aa4

Please sign in to comment.