study.

Issue and Inspect Certificates with cert-manager · Kubernetes

A Ready Certificate and a certificate trusted by browsers are different outcomes.

← Kubernetes

Learn with progress and quizzes

First, understand the concepts.

Certificates and private keys

A certificate describes server identities and a public key; the private key remains with its owner. tls.crt contains public certificate data, while tls.key is sensitive. Validity, DNS SANs, and the trust chain matter to clients.

Issuer, ClusterIssuer, and Certificate

An Issuer serves its namespace; a ClusterIssuer is cluster-scoped. A Certificate declares identities, a target Secret, and issuerRef. Controllers reconcile issuance and renewal; installing only CRDs does not run this workflow.

Renewal and consumers

Validity and renewBefore influence renewal scheduling; inspect status.renewalTime. Secret updates do not prove that an application or proxy reloaded the new certificate. Account for key rotation as well.

ACME versus self-signing

Self-signing teaches the resource flow without public domains. Public ACME issuance verifies domain control using HTTP-01 paths or DNS-01 TXT records. DNS-01 can support wildcards; restrict DNS credential permissions.

Why it matters

Manual expiry tracking can miss renewals. Declare certificate intent and let a controller reconcile issuance, while separately checking trust and server reload behavior.

Work through the reasoning

Trace issuance

Start with issuerRef and secretName. CertificateRequest represents an issuance request and the Issuer supplies issuance configuration. ACME adds Order and Challenge; SelfSigned does not require them.

Distinguish renewal from reissuance

notAfter and renewalTime describe expiry and scheduled renewal. This lab changes DNS names to increment revision; it does not wait for scheduled renewal. Inspect public SANs without printing private keys.

Learn by doing.

Use kubectl, a personal practice Kubernetes cluster, and a POSIX shell. cert-manager and VPA labs require the components specified in each lesson. Node-changing labs require a dedicated disposable worker. Use the practice namespaces.

A compatible cert-manager controller, webhook, and CRDs must already be installed and ready in a practice cluster; follow official installation guidance first. You need kubectl, openssl, and base64. The commands issue a self-signed certificate and trigger reissuance by changing DNS names, without modifying real DNS or contacting a public CA.

(
set -eu
kubectl config current-context
kubectl get crd certificates.cert-manager.io issuers.cert-manager.io
kubectl create namespace study-cert-manager --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -n study-cert-manager -f - <<'YAML'
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: lab-selfsigned
spec:
  selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: lab-tls
spec:
  secretName: lab-tls
  duration: 24h
  renewBefore: 8h
  subject:
    organizations: [GreatJIN Study Lab]
  dnsNames: [app.example.test]
  privateKey:
    algorithm: ECDSA
    size: 256
    rotationPolicy: Always
  issuerRef:
    name: lab-selfsigned
    kind: Issuer
YAML
kubectl wait -n study-cert-manager --for=condition=Ready issuer/lab-selfsigned --timeout=120s
kubectl wait -n study-cert-manager --for=condition=Ready certificate/lab-tls --timeout=180s
kubectl get certificate lab-tls -n study-cert-manager -o jsonpath='{.status.revision}{"\n"}{.status.notAfter}{"\n"}{.status.renewalTime}{"\n"}'
kubectl get secret lab-tls -n study-cert-manager -o jsonpath='{.type}{"\n"}'
kubectl get secret lab-tls -n study-cert-manager -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
kubectl patch certificate lab-tls -n study-cert-manager --type=merge -p '{"spec":{"dnsNames":["app.example.test","api.example.test"]}}'
kubectl wait -n study-cert-manager --for=jsonpath='{.status.revision}'=2 certificate/lab-tls --timeout=180s
kubectl wait -n study-cert-manager --for=condition=Ready certificate/lab-tls --timeout=120s
kubectl get secret lab-tls -n study-cert-manager -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -ext subjectAltName
)

How to check your result

Check Ready=True, Secret type kubernetes.io/tls, and the app.example.test SAN. After the change, expect revision 2 and api.example.test. renewalTime is scheduled timing, not proof that time-based renewal was exercised. Diagnose Certificate, CertificateRequest, and Issuer conditions/events; inspect Order and Challenge only for ACME.

Clean up practice resources

Run after checking the result. Confirm these resources belong to your practice run and contain no data you need to keep.

kubectl delete namespace study-cert-manager

Apply what you learned

Self-signing works, but public ACME HTTP-01 issuance stays Pending. What else should you investigate?

Reveal the reasoning after trying

Inspect Order and Challenge after CertificateRequest, then actual DNS, ingress class, solver routing, and HTTP reachability from the CA. DNS-01 instead requires checking TXT propagation and permissions. Use staging for public CA setup; this self-signed lab does not verify public issuance.

Ready to check your understanding?

What does Ready=True mean for this self-signed lab certificate?

  1. Browsers automatically trust it
  2. Issuance succeeded; client trust and an HTTPS server still require separate setup
  3. Real DNS records were automatically created
  4. The private key is safe to publish
Reveal the reasoning after trying

Issuance succeeded; client trust and an HTTPS server still require separate setup

Issuance, trust, DNS, and server TLS configuration are separate. A self-signed Certificate does not automatically create browser trust or an HTTPS endpoint.

Official documentation · Issue and Inspect Certificates with cert-manager · cert-manager installation · official documentation · ACME issuance · official documentation