Skip to content
Inspecting Certificate Information (1/2) - Root CA and API Server

Inspecting Certificate Information (1/2) - Root CA and API Server

Inspect the certificate file information for the Kubernetes cluster’s Root CA certificate and the certificate used by the API Server.


Certificate Inspection Overview

While operating a cluster, it is very important to verify certificate validity and trust relationships.

TargetFile PathMain Role
Root CA/etc/kubernetes/pki/ca.crtAnchor of cluster trust (parent of all certificates)
API Server/etc/kubernetes/pki/apiserver.crtServer certificate proving the API server’s identity

1. Inspecting the Root CA Certificate

The Root CA certificate has a Self-Signed structure that vouches for itself.

Command to View Detailed Information

openssl x509 -in /etc/kubernetes/pki/ca.crt -text -noout

Analysis of Key Fields

    graph TD
    CA[Root CA certificate information]
    CA --> Issuer["Issuer: CN = kubernetes-ca (itself)"]
    CA --> Subject["Subject: CN = kubernetes-ca (itself)"]
    CA --> Validity["Validity: about 10 years (long-lived by design)"]
    CA --> Usage["Key Usage: Certificate Sign (for signing certificates)"]
    CA --> Basic["Basic Constraints: CA:TRUE (is a certificate authority)"]
  

2. Inspecting the API Server Certificate

The API Server certificate is a leaf (end-entity) certificate signed by the Root CA.

Command to View Detailed Information

openssl x509 -in /etc/kubernetes/pki/apiserver.crt -text -noout

Analysis of Key Fields

FieldContentDescription
IssuerCN = kubernetes-caShows that it was issued by the Root CA
SubjectCN = kube-apiserverIdentifies the certificate owner as the API server
ValidityAbout 1 yearShorter than the Root CA’s validity, for security
SANDNS:kubernetes, IP:10.96.0.1...Subject Alternative Names: the additional DNS names and IPs that clients can use to connect

3. Verifying Trust Relationships Between Certificates

Use the following command to verify that the API server certificate was signed by the Root CA.

# Signature verification command
openssl verify -CAfile /etc/kubernetes/pki/ca.crt /etc/kubernetes/pki/apiserver.crt

# Output
# /etc/kubernetes/pki/apiserver.crt: OK

Being able to inspect and verify certificates yourself is essential for assessing a cluster’s security posture and troubleshooting authentication failures.