Skip to main content

5.2.2.1. Root certificates

Certificate Authority (CA) is a trusted source that issues root certificates used to sign all other certificates within the Kubernetes cluster.

CA certificates play a key role in establishing trust between components, ensuring authentication, encryption, and integrity of communications.

This section describes the process of obtaining root certificates that are used to sign the remaining certificates in the Kubernetes cluster.

Creating root certificates

● Required

Kubernetes CA

Purpose: Kubernetes root Certificate Authority (CA). Signs the server and client certificates for kube-apiserver, kubelet, kube-controller-manager, and kube-scheduler. All cluster components trust this CA for TLS connection verification.

Note

Note: this block describes only the process of creating Kubernetes CA root certificates.

Working directory

mkdir -p /etc/kubernetes/openssl
mkdir -p /etc/kubernetes/pki

Configuration

cat <<EOF > /etc/kubernetes/openssl/ca.conf
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_ca
prompt = no

[req_distinguished_name]
CN = kubernetes

[v3_ca]
keyUsage = critical, keyCertSign, keyEncipherment, digitalSignature
basicConstraints = critical,CA:TRUE
EOF

Private key generation

openssl genrsa \
-out /etc/kubernetes/pki/ca.key 2048

Public key generation

openssl req \
-x509 \
-new \
-nodes \
-key /etc/kubernetes/pki/ca.key \
-sha256 \
-days 3650 \
-out /etc/kubernetes/pki/ca.crt \
-config /etc/kubernetes/openssl/ca.conf
Certificate readiness verification
Note

This section depends on the following sections:

/etc/kubernetes/openssl/cert-report.sh /etc/kubernetes/pki/ca.crt
Command output
CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca Oct 20, 2034 22:04 UTC 9y no