You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently only the CA certificate is added to the trustore.
I would like to add others CA certificates the trustore.
Describe the solution you'd like
Mount others certificates to one directory per certificate (so the certificate file will be updated when the secret is changed), for example /pulsar/certs/trusted/{alias}/ca.crt.
slightly related to #359 (comment) .
I'd like to get rid of keytool.sh completely for the typical use case of a single certificate file.
Update keytool.sh to load those external certificates to the trustore.
I don't know yet how to restart the pod when one certificate file is updated
For multiple certs, one option would be to have a background job poll file paths and trigger when the certificate files change to combine them into a single file. This background job could be started in the container command. To keep it lightweight, it could be a plain bash script or Python script. There isn't a need to restart the pod since Pulsar, BookKeeper and ZooKeeper support reloading the keystore and truststore files when it changes.
Since #613 gets rid of the use of JKS truststores and keystores, it will be possible to use a PEM bundle file as the truststore which is simply a text file with all trusted CA certificates appended.
The main challenge to solve would be to start a background job (bash script) to watch for the individual certificate files and when any of them change, update the combined PEM bundle file (which is just simple done by concatenating all individual CA files into one file). The configuration of component's trusted certs would just point to the bundle file and the component (broker, zookeeper, bookie) would reload the changes when the file changes.
Perhaps it should be configurable on a component basis what additional CA certs are trusted?
The main challenge to solve would be to start a background job (bash script) to watch for the individual certificate files and when any of them change, update the combined PEM bundle file (which is just simple done by concatenating all individual CA files into one file). The configuration of component's trusted certs would just point to the bundle file and the component (broker, zookeeper, bookie) would reload the changes when the file changes.
When you say "the component could reload the changes when the file changes" : do we need to restart pod or not ?
Maybe we could use a cronjob to update the combined PEM ? Or you prefer a sidecar with a background process ?
When you say "the component could reload the changes when the file changes" : do we need to restart pod or not ?
There is no need to restart pods.
Maybe we could use a cronjob to update the combined PEM ? Or you prefer a sidecar with a background process ?
I think that the files made available by mounting secrets are read-only. A sidecar / background process would be more useful. It would simply have a loop where it checks all files for modification time and if any change, it would combine them into a single file. With PEM files, it's really simple since they are text files that can be concatenated into a single "pem bundle" file to form a "trust store".
When this feature is enabled, the component would just be pointed to the concatenated file instead of the file provided directly by cert manager.
I think that some thought should be put into whether additional trusted CAs would be added only to specific components such as the broker and proxy or whether it should apply to internal components such as bookkeeper and zookeeper.
The solution for combining the files might require executing the concatenation once in an init container so that the file is available when the component starts and then having a sidecar or background job to keep the concatenated file up-to-date.
Activity
lhotari commentedon May 28, 2025
slightly related to #359 (comment) .
I'd like to get rid of keytool.sh completely for the typical use case of a single certificate file.
For multiple certs, one option would be to have a background job poll file paths and trigger when the certificate files change to combine them into a single file. This background job could be started in the container command. To keep it lightweight, it could be a plain bash script or Python script. There isn't a need to restart the pod since Pulsar, BookKeeper and ZooKeeper support reloading the keystore and truststore files when it changes.
lhotari commentedon May 28, 2025
keytool.shhas been removed in #613 .lhotari commentedon May 28, 2025
This could be achieved with https://docs.stakater.com/reloader/.
lhotari commentedon May 29, 2025
Since #613 gets rid of the use of JKS truststores and keystores, it will be possible to use a PEM bundle file as the truststore which is simply a text file with all trusted CA certificates appended.
The main challenge to solve would be to start a background job (bash script) to watch for the individual certificate files and when any of them change, update the combined PEM bundle file (which is just simple done by concatenating all individual CA files into one file). The configuration of component's trusted certs would just point to the bundle file and the component (broker, zookeeper, bookie) would reload the changes when the file changes.
Perhaps it should be configurable on a component basis what additional CA certs are trusted?
gulecroc commentedon Jun 6, 2025
When you say "the component could reload the changes when the file changes" : do we need to restart pod or not ?
Maybe we could use a cronjob to update the combined PEM ? Or you prefer a sidecar with a background process ?
lhotari commentedon Jun 6, 2025
There is no need to restart pods.
I think that the files made available by mounting secrets are read-only. A sidecar / background process would be more useful. It would simply have a loop where it checks all files for modification time and if any change, it would combine them into a single file. With PEM files, it's really simple since they are text files that can be concatenated into a single "pem bundle" file to form a "trust store".
When this feature is enabled, the component would just be pointed to the concatenated file instead of the file provided directly by cert manager.
I think that some thought should be put into whether additional trusted CAs would be added only to specific components such as the broker and proxy or whether it should apply to internal components such as bookkeeper and zookeeper.
The solution for combining the files might require executing the concatenation once in an init container so that the file is available when the component starts and then having a sidecar or background job to keep the concatenated file up-to-date.