Skip to content

Commit

Permalink
Fix KEDA crashes when using cert-manager certificates and restricted …
Browse files Browse the repository at this point in the history
…secret access (#518)

* Fix KEDA crashes when using cert-manager certificates and restricted secret access

Allow KEDA operator to get, list and watch secrets in its own namespace
when restricted mode and certmanager are enabled.

Signed-off-by: Guillaume Jacquet <[email protected]>

* revert version bump

Signed-off-by: Guillaume Jacquet <[email protected]>

* extra conditions

Signed-off-by: Guillaume Jacquet <[email protected]>

* fix )

Signed-off-by: Guillaume Jacquet <[email protected]>

* extra conditions

Signed-off-by: Guillaume Jacquet <[email protected]>

* fix role creation logic

Signed-off-by: Guillaume Jacquet <[email protected]>

* Update keda/templates/manager/role.yaml

Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>

* Update keda/templates/manager/rolebinding.yaml

Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>

* fixes

Signed-off-by: Guillaume Jacquet <[email protected]>

---------

Signed-off-by: Guillaume Jacquet <[email protected]>
Co-authored-by: Jorge Turrado Ferrero <[email protected]>
  • Loading branch information
gjacquet and JorTurFer authored Sep 25, 2023
1 parent 7a4ba4a commit 991a617
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions keda/templates/manager/role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
{{- 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 @@ -17,11 +17,13 @@ rules:
resources:
- secrets
verbs:
{{- if and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled) }}
- create
- delete
- get
- list
- patch
- update
{{- end }}
- watch
- get
- list
{{- end -}}
2 changes: 1 addition & 1 deletion keda/templates/manager/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
{{- if or (and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled)) (.Values.permissions.operator.restrict.secret) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand Down

0 comments on commit 991a617

Please sign in to comment.