Skip to content

Add CA-injector Job for webhook caBundle rotation - #594

Open
shivangi660 wants to merge 1 commit into
temporalio:mainfrom
shivangi660:add-webhook-ca-injector-job
Open

shivangi660 wants to merge 1 commit into
temporalio:mainfrom
shivangi660:add-webhook-ca-injector-job

Conversation

@shivangi660

Copy link
Copy Markdown
Contributor

Fixes #591

Summary

certmanager.caBundle is a static value — fine for a one-time cert, but goes stale whenever the external CA rotates, for deployments running certmanager.enabled: false with their own TLS cert issuance (e.g. a platform-managed PKI; see #590 / #593 for the crash-loop that motivated configurable cert paths in the first place).

Adds an opt-in certmanager.caInjector Helm post-install/post-upgrade hook Job:

  • ServiceAccount + ClusterRole (scoped to get/patch on just this release's two ValidatingWebhookConfigurations via resourceNames) + ClusterRoleBinding.
  • Job running bitnami/kubectl that reads a CA from a mounted Secret (certmanager.caInjector.caSecretName/caSecretKey) and JSON-patches clientConfig.caBundle on both ValidatingWebhookConfigurations.

Runs at every install/upgrade, so the API server's trust always matches whatever cert is currently live — no manual re-sync needed when the CA rotates. Off by default (certmanager.caInjector.enabled: false); ignored entirely when certmanager.enabled: true (cert-manager already handles this via its own CA injection annotation).

Test plan

  • helm lint helm/temporal-worker-controller
  • helm template with certmanager.caInjector.enabled: true renders ServiceAccount/ClusterRole/ClusterRoleBinding/Job correctly, scoped to the release's own webhook config names.
  • Default render (caInjector.enabled: false, the default) produces zero ca-injector resources — confirmed no change to existing output.
  • values.schema.json updated alongside values.yaml per hack/check-helm-values-schema.sh.
  • Live cluster test against a real external CA/Secret (don't currently have a cluster with this configuration handy — happy to have this validated in review, or will report back once I can deploy it).

)

certmanager.caBundle is a static value that goes stale when the external
CA rotates, for deployments running certmanager.enabled: false with their
own TLS cert (e.g. a platform-managed PKI, see temporalio#590/temporalio#593). Adds an
opt-in certmanager.caInjector.enabled Helm hook Job (ServiceAccount +
ClusterRole scoped to get/patch on just this release's two
ValidatingWebhookConfigurations by resourceName + Job) that reads the CA
from a Secret and JSON-patches clientConfig.caBundle on both
ValidatingWebhookConfigurations at every install/upgrade, so the API
server always trusts the currently-live cert regardless of rotation.

Off by default; ignored when certmanager.enabled: true.
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.

Helm chart: ValidatingWebhookConfiguration caBundle not wired to webhook TLS cert

1 participant