Skip to content

fix(keda): don't gate cert rotation on metrics server being enabled#852

Merged
zroubalik merged 1 commit into
kedacore:mainfrom
zammitjohn:fix/cert-rotation-gated-on-metrics-server
May 27, 2026
Merged

fix(keda): don't gate cert rotation on metrics server being enabled#852
zroubalik merged 1 commit into
kedacore:mainfrom
zammitjohn:fix/cert-rotation-gated-on-metrics-server

Conversation

@zammitjohn

@zammitjohn zammitjohn commented May 6, 2026

Copy link
Copy Markdown
Contributor

PR #819 added .Values.metricsServer.enabled to the --enable-cert-rotation gate in keda/templates/manager/deployment.yaml. As a result, setting metricsServer.enabled=false also disables cert rotation for the operator and admission webhooks, so the kedaorg-certs secret is never created.

Symptoms reported in #849:

  • KEDA operator crashloops: open /certs/ca.crt: no such file or directory
  • Admission webhooks stuck in ContainerCreating: MountVolume.SetUp failed for volume "certificates": secret "kedaorg-certs" not found
  • ScaledJobs never start because the operator never becomes ready

This restores the pre-#819 expression so cert rotation is gated only on autoGenerated and !certManager.enabled, independent of the metrics server. The metrics server's own deployment and APIService are still gated separately by {{- if .Values.metricsServer.enabled }}, so disabling it continues to work as intended.

Verified via helm template:

Config Before After
defaults true true
metricsServer.enabled=false false (bug) true
certManager.enabled=true false false
certificates.autoGenerated=false false false

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 #849

PR kedacore#819 added .Values.metricsServer.enabled to the --enable-cert-rotation
gate, which means setting metricsServer.enabled=false also disables cert
rotation for the operator and admission webhooks. The kedaorg-certs secret
is then never created, leaving the operator crashlooping on missing
/certs/ca.crt and webhooks stuck in ContainerCreating.

Restore the pre-kedacore#819 expression so cert rotation is gated only on
autoGenerated and !certManager.enabled, independent of the metrics server.

Fixes kedacore#849

Signed-off-by: John Zammit <[email protected]>
@zammitjohn zammitjohn requested review from a team as code owners May 6, 2026 14:07
@JorTurFer

Copy link
Copy Markdown
Member

@zroubalik @wozniakjan

@zammitjohn

Copy link
Copy Markdown
Contributor Author

@zroubalik @wozniakjan

Can we merge this?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Restores KEDA operator/admission webhook certificate rotation behavior by removing the unintended dependency on metricsServer.enabled, ensuring cert generation/rotation still occurs when the metrics server is disabled.

Changes:

  • Remove .Values.metricsServer.enabled from the --enable-cert-rotation gating expression in the operator deployment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wozniakjan wozniakjan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks! yeah this was definitely an oversight

@zroubalik zroubalik merged commit c16f030 into kedacore:main May 27, 2026
27 checks passed
@zroubalik

Copy link
Copy Markdown
Member

@zammitjohn thanks!

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.

--enable-cert-rotation incorrectly gated on metricsServer.enabled, breaking operator/webhook certs when metrics server is disabled

5 participants