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:
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 yourca.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.