Generate the TLS certificates required by ClickHouse Private’s server, keeper, and client components. The script below runs OpenSSL inside a FIPS-enabled Red Hat UBI8 container to ensure FIPS 140-3 compliance.
If your organization has an existing PKI process, you can use it instead — just ensure the output certificates match the SAN requirements and secret key names below.
For the concepts behind these certificates — their purpose, the verification modes, and how rotation behaves — see PKI and mTLS in ClickHouse Private.
Prerequisites
- Docker installed with access to
registry.access.redhat.com/ubi8/ubi
- Cluster name chosen (this guide uses
default-xx-01)
ClickHouse Private Requirements
Three certificate sets are needed, signed by a common CA:
- Minimum RSA 3072-bit key size for FIPS compliance
- If your Kubernetes cluster uses a domain other than
.cluster.local, replace it in the SANs
- A unique set of certificates (excluding CA) must be created per ClickHouse cluster
Generate the Certificates
Warning: The certificates generated below expire after 365 days (the CA after 3650 days). Update the -days values to match your security requirements.
Update the variables at the top of the script, then run it:
After running, you will have the following files in your current directory:
Create Kubernetes Secrets
Secrets must be installed in the same namespace where the ClickHouse cluster will run (ns-<cluster_name>). Do not change the secret names or key names.
Using Your Own CA
If you have an existing certificate authority, skip the CA generation step in the script. Mount your CA certificate into the Docker container for signing, and use your ca.crt file wherever this guide references it (including the Kubernetes secrets above). A unique set of certificates (excluding the CA) must be created for each ClickHouse cluster. Last modified on August 7, 2026