Repository navigation
Support externally managed TLS certificates for all components - #724
Merged
Merged
Conversation
Document how to use publicly trusted and externally managed TLS certificates with the chart (apache#721): - Add `createCert` to the broker, bookie, zookeeper, autorecovery, toolset and standalone TLS settings, as the proxy and function worker already have, so that all the certificate Secrets can be provided externally. Only an explicit `createCert: false` disables the certificate, so values without the key, such as reused values from an earlier release, keep creating it. - Don't require the unused tls-combined.pem key in the proxy Secret, so that a publicly trusted certificate Secret can be used for the proxy. - Document in values.yaml why publicly trusted certificates can't be used between the components (cluster-internal names, and the removal of the clientAuth extended key usage from public certificates), the recommended setup with a public certificate for the proxy only, the required keys and key format of externally managed certificate Secrets (PKCS#8 and tls-combined.pem for ZooKeeper TLS), and the purpose of certs.issuers.ca.secretName. - Explain in the certs.issuers.ca.secretName error message what the Secret must contain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #721
Motivation
#721 asks how to use publicly trusted certificates (issued by an ACME issuer through cert-manager) with the chart, and reports several problems when trying to provide the certificates externally:
createCert: false). The broker, bookie, ZooKeeper, autorecovery, toolset and standalone certificates are always created by the chart.certs.issuers.ca.secretName) is required even when no certificates are created by the chart, and its purpose isn't documented.InvalidKeySpecException: Inappropriate key specification: Unable to decode keywith an externally createdtls-combined.pem.The Kubernetes service names can't be removed from the certificates: the components connect to each other using these names and verify that the certificate matches. In addition, the components present their certificates as TLS client certificates (the brokers to the bookies, and all ZooKeeper clients to ZooKeeper), and public CAs are removing the clientAuth extended key usage from the certificates they issue (see the ASF advisory and the users@/dev@ thread). Publicly trusted certificates therefore only work for the proxy, which uses its certificate as a server certificate.
Modifications
createCert(defaulttrue) totls.broker,tls.bookie,tls.zookeeper,tls.autorecovery,tls.toolsetandtls.standalone, astls.proxyandtls.function_workeralready have, so that all certificate Secrets can be provided externally. Only an explicitcreateCert: false(bool or string) disables a certificate, so values without the key, for example reused values from an earlier release withhelm upgrade --reuse-values, keep creating it.tls-combined.pemkey from the proxy Secret. Nothing reads/pulsar/certs/proxy/tls-combined.pem, and the requirement prevented using a plain publicly trusted certificate Secret for the proxy when ZooKeeper TLS is enabled.## TLScomments ofvalues.yaml:tls.proxy.createCert: falsewith your own cert-manager Certificate), and a private CA for the other components (certs.internal_issuer, or a cert-manager issuer backed by a private CA such as OpenBao, Vault or step-ca throughcerts.issuers.ca);advertisedListeners, which the chart doesn't support yet;tls.crt,tls.keyand, with ZooKeeper TLS,tls-combined.pem), that the private key must be PKCS#8 (the cause of the ZooKeeper error in TLS Configuration with Public Certificates #721), and the matching cert-manager settings;certs.issuers.ca.secretName.certs.issuers.ca.secretNameerror message what the Secret must contain.Verifying this change
helm lintpasses, and the chart renders with all.ci/clusters/*.yamland.ci/templates-all-values*.yamlvalues files..ci/test-certificate-san-modes.shpasses.With TLS enabled for all components (default values otherwise), the rendered output is unchanged apart from the removed
tls-combined.pemitem of the proxy certificate volume, both for the regular and the standalone deployment.With
createCert: falsefor all components,certs.internal_issuer.enabled: falseand onlycerts.issuers.ca.secretNameset, the chart renders without any Certificate or Issuer resources.--set-string tls.broker.createCert=falseskips only the broker certificate, and values without thecreateCertkey still create the certificate.Make sure that the change passes the CI checks.