Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

gjacquet
Copy link
Contributor

@gjacquet gjacquet commented Sep 8, 2023

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

Checklist

  • I have verified that my change is according to the deprecations & breaking changes policy
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • README is updated with new configuration values (if applicable) learn more
  • A PR is opened to update KEDA core (repo) (if applicable, ie. when deployment manifests are modified)

Fixes #505

…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]>
@gjacquet gjacquet force-pushed the cert-manager-restricted-secret-access branch from c48465c to 84a116d Compare September 8, 2023 18:05
@gjacquet gjacquet marked this pull request as ready for review September 8, 2023 18:11
@gjacquet gjacquet requested a review from a team as a code owner September 8, 2023 18:11
keda/Chart.yaml Outdated Show resolved Hide resolved
Signed-off-by: Guillaume Jacquet <[email protected]>
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!
I think that we be more fine to not deploy the Role if it's needed (it's not a pain, but if we don't deploy not required Roles is always better). WDYT?

@@ -1,4 +1,4 @@
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check if the restrict access is set instead of adding the role always. I mean, if this manifest has to be deployed if we are using self generated certs without cert manager OR if we set restricted access. But if I set cert manager and I don't set restricted access, this role isn't required as it's covered by the ClusterRole

@@ -17,11 +17,13 @@ rules:
resources:
- secrets
verbs:
{{- if not .Values.certificates.certManager.enabled }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that with my previous comment, the condition here should be if self generated AND NOT cert manager

@@ -1,4 +1,4 @@
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
{{- if or .Values.certificates.autoGenerated .Values.certificates.certManager.enabled }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as the other file comment for the condition

@JorTurFer
Copy link
Member

Hi @gjacquet
We aim to cut a release this week, could you address the comments?

Signed-off-by: Guillaume Jacquet <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>
@gjacquet
Copy link
Contributor Author

@JorTurFer this should be good now.

keda/templates/manager/role.yaml Outdated Show resolved Hide resolved
keda/templates/manager/role.yaml Outdated Show resolved Hide resolved
keda/templates/manager/rolebinding.yaml Outdated Show resolved Hide resolved
gjacquet and others added 3 commits September 25, 2023 16:09
Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>
Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>
Signed-off-by: Guillaume Jacquet <[email protected]>
@gjacquet
Copy link
Contributor Author

applied suggestions

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@JorTurFer JorTurFer enabled auto-merge (squash) September 25, 2023 22:08
@JorTurFer JorTurFer merged commit 991a617 into kedacore:main Sep 25, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KEDA crashes when using cert-manager certificates and restricted secret access
3 participants