Skip to content

Self-signed CA gets a new private key on every renewal with cert-manager 1.18+, breaking TLS between components #708

Closed

Description

@dejanzele

Describe the bug

The CA Certificate created by the internal self-signed issuer (tls-cert-internal-issuer.yaml) doesn't set spec.privateKey.rotationPolicy. cert-manager 1.18 changed the default for that field from Never to Always (GA in 1.20, where it can no longer be turned off). With Always, every renewal of the CA certificate also generates a new CA private key.

The chart defaults the CA to duration: 2160h / renewBefore: 360h, so this happens roughly every 75 days. After a re-key, the component certificates are still the ones signed by the old key. As soon as a component reloads the new ca.crt (which works well since #613), it stops trusting the other components and handshakes fail with PKIX path validation failed: Path does not chain with any of the trust anchors. The cluster stays broken until cert-manager has re-issued every leaf certificate and every component has picked the new ones up.

On cert-manager older than 1.18 this never happened. Renewal reused the CA key, so certificates issued before the renewal kept validating.

To Reproduce

  1. Install the chart with tls.enabled=true and certs.internal_issuer.enabled=true on cert-manager >= 1.18.
  2. Force a CA renewal with cmctl renew <release>-pulsar-ca -n <namespace>, or wait for the renewal window.
  3. Compare the public key in the CA secret before and after: it changes.
  4. Watch broker/bookie/zookeeper handshakes fail until all leaf certificates have been re-issued.

Expected behavior

Renewing the CA certificate should not invalidate the certificates it issued. The CA Certificate should set privateKey.rotationPolicy: Never, which was the default when this template was written. A deliberate CA re-key is a separate concern and can already be handled with tls.<component>.cacerts (#619) by keeping the old and new CA in the truststore while certificates get re-issued.

Activity

  1. dejanzele commented on Jul 14, 2026

    @dejanzele
    ContributorAuthor

    @lhotari @gulecroc @michaeljmarshall I saw you worked on cert-reload and similar work regarding PKI, what do you think about this proposal?

    I think this is a very sane feature ask which would benefit the community, as currently you cannot decouple CA cert and CA key rotation.

  2. lhotari commented on Jul 14, 2026

    @lhotari
    Member

    @lhotari @gulecroc @michaeljmarshall I saw you worked on cert-reload and similar work regarding PKI, what do you think about this proposal?

    I think this is a very sane feature ask which would benefit the community, as currently you cannot decouple CA cert and CA key rotation.

    LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions