Certificate Architecture
vCluster uses multiple certificate authorities (CAs) and certificates for different components:Certificate Authorities
vCluster creates the following CAs:-
Kubernetes CA (
ca.crt,ca.key)- Signs all Kubernetes component certificates
- Used for API server, controller manager, scheduler
-
Server CA (
server-ca.crt,server-ca.key)- Used for server certificate validation
- Copy of the main Kubernetes CA
-
Client CA (
client-ca.crt,client-ca.key)- Validates client certificates
- Copy of the main Kubernetes CA
-
etcd CA (
etcd/ca.crt,etcd/ca.key)- Dedicated CA for etcd cluster
- Ensures etcd communication security
-
Front Proxy CA (
front-proxy-ca.crt,front-proxy-ca.key)- Used for extension API servers
- Enables aggregated API servers
Component Certificates
Frompkg/certs/constants.go, vCluster manages these certificates:
Certificate Validity
By default, certificates are valid for 10 years:Certificate Storage
Certificates are stored in a Kubernetes Secret in the host cluster:Automatic Certificate Generation
vCluster automatically generates certificates during initialization:Extra SANs (Subject Alternative Names)
Configure additional SANs for the API server certificate:Certificate Rotation
vCluster supports automatic certificate rotation for leaf certificates and manual rotation for CA certificates.Automatic Leaf Certificate Renewal
vCluster automatically renews leaf certificates that are expiring:- CA certificates and service account keys are preserved
- Expiring leaf certificates are removed
- New leaf certificates are generated using existing CAs
- The certificate secret is updated
Manual Certificate Rotation
Rotate leaf certificates manually:Rotate CA Certificates
Rotate the entire PKI including CA certificates:Check Certificate Expiry
Check certificate expiration dates:Custom Certificate Configuration
Use External Certificates
Provide your own certificates by creating the secret before vCluster starts:Generate Kubeconfig with Custom Certificates
Create a kubeconfig file with custom certificates:Certificate Synchronization
In standalone mode, certificates are stored on disk:/data/pki/
For high availability, certificates are synced from the secret:
Best Practices
Monitor Certificate Expiry
Set up monitoring for certificate expiration:Backup Certificates
Backup certificate secrets regularly:Rotate Before Expiry
Rotate certificates well before expiration:- Leaf certificates: Rotate 30 days before expiry
- CA certificates: Plan rotation 90 days in advance