> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cert Manager Deep Dive

> Explains cert-manager, a Kubernetes operator that automates TLS certificate issuance, renewal, and in-place Secret storage using Issuer and ClusterIssuer resources.

When an application uses HTTPS, a certificate proves the identity of the endpoint to browsers, clients, and other services. Certificates ensure encrypted traffic and trust between parties.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/euSqH_V95DCdREv4/images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/https-needs-certificate-browser-connection.jpg?fit=max&auto=format&n=euSqH_V95DCdREv4&q=85&s=5cbce516723cd70adae451812ad93199" alt="The image illustrates why HTTPS needs a certificate, showing a connection between a browser/client and a service to verify identity." width="1920" height="1080" data-path="images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/https-needs-certificate-browser-connection.jpg" />
</Frame>

Managing a single certificate by hand is straightforward. The real challenge is lifecycle management: certificates expire, they must be stored where applications can access them, and replacements should not require changing application configuration.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/euSqH_V95DCdREv4/images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/the-hard-part-caring-flowchart.jpg?fit=max&auto=format&n=euSqH_V95DCdREv4&q=85&s=60368269ce5eb8591e2f794fe584f911" alt="The image is a flowchart titled &#x22;The Hard Part Is Caring Over Time,&#x22; explaining the challenges of certificate management: expiration, storage accessibility, and replacement processes." width="1920" height="1080" data-path="images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/the-hard-part-caring-flowchart.jpg" />
</Frame>

cert-manager implements that lifecycle as a Kubernetes operator. You declare the certificate you want as a Kubernetes resource, cert-manager watches that resource, and it creates or updates a Kubernetes Secret containing the certificate and key. Think of cert-manager as a certificate desk inside the cluster: instead of managing files manually, developers file a Kubernetes request and let the operator reconcile the result.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/euSqH_V95DCdREv4/images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/certificate-desk-cluster-workflow-illustration.jpg?fit=max&auto=format&n=euSqH_V95DCdREv4&q=85&s=e18b73f6d9552236721c248e8ec3c2f7" alt="The image illustrates a workflow for &#x22;A Certificate Desk Inside the Cluster,&#x22; showing the process from handling files by hand to a certificate desk, followed by filing a request as a Kubernetes resource." width="1920" height="1080" data-path="images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/certificate-desk-cluster-workflow-illustration.jpg" />
</Frame>

Key objects in cert-manager

* Certificate resource: a request that declares the DNS names (subject / SANs), the Issuer to use, and the target Secret name.
* Issuer / ClusterIssuer: the authority that fulfills the request by obtaining or issuing the certificate.
* Secret: where the resulting TLS material is stored (commonly `kubernetes.io/tls` with `tls.crt` and `tls.key`).

A typical Certificate request includes:

* DNS name(s) the certificate should cover.
* Which Issuer or ClusterIssuer should obtain the certificate.
* Which Kubernetes Secret should hold the TLS data.

Below is an example Certificate resource (minimal):

```yaml theme={null}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: example-com-tls
  namespace: default
spec:
  dnsNames:
    - example.com
    - www.example.com
  secretName: example-com-tls-secret
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
```

And a minimal ClusterIssuer that uses Let’s Encrypt (ACME):

```yaml theme={null}
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: admin@example.com
    privateKeySecretRef:
      name: letsencrypt-prod-account-key
    solvers:
      - http01:
          ingress:
            class: nginx
```

Cert-manager writes the resulting certificate and private key into the target Secret. For TLS-type Secrets, the Secret contains the keys `tls.crt` and `tls.key`:

```yaml theme={null}
apiVersion: v1
kind: Secret
metadata:
  name: example-com-tls-secret
  namespace: default
type: kubernetes.io/tls
data:
  tls.crt: <base64-encoded-certificate-chain>
  tls.key: <base64-encoded-private-key>
```

Keep this mental model:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/euSqH_V95DCdREv4/images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/certificate-request-secret-holding-diagram.jpg?fit=max&auto=format&n=euSqH_V95DCdREv4&q=85&s=d6f19628d74f4b08d7ca450398c3f404" alt="The image is a diagram showing a process where a certificate request leads to holding the certificate material in a secret." width="1920" height="1080" data-path="images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/certificate-request-secret-holding-diagram.jpg" />
</Frame>

Certificate resource = request.\
Secret = output (contains `tls.crt` and `tls.key`).

Issuer vs ClusterIssuer

| Resource      | Scope            | Use case                                                                        |
| ------------- | ---------------- | ------------------------------------------------------------------------------- |
| Issuer        | Namespace-scoped | Issuing certificates for resources inside a single namespace.                   |
| ClusterIssuer | Cluster-scoped   | Share a single issuer (e.g., Let’s Encrypt account) across multiple namespaces. |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/euSqH_V95DCdREv4/images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/issuer-vs-clusterissuer-namespace-comparison.jpg?fit=max&auto=format&n=euSqH_V95DCdREv4&q=85&s=f755bfe7e458109018cbb1e8f58dcd28" alt="The image compares an Issuer, which is scoped to one namespace, with a ClusterIssuer, which is shared across multiple namespaces." width="1920" height="1080" data-path="images/Kubernetes-Operators/Consuming-Popular-Operators/Cert-Manager-Deep-Dive/issuer-vs-clusterissuer-namespace-comparison.jpg" />
</Frame>

Renewal automation

Renewal is where cert-manager provides the greatest value. Certificates expire; cert-manager continuously monitors Certificate resources and requests replacements before expiry. Crucially, cert-manager updates the same Secret name in-place, so applications can keep referencing a stable Secret while its contents are rotated.

When cert-manager is installed you’ll typically see these components:

* Controller(s) that reconcile Certificate, Issuer, and other cert-manager CRs.
* Validating webhook that validates cert-manager resources against the API.
* CA injector (cainjector) which injects CA bundles where needed (for example, into webhook configurations).

Operational tips

* Verify the Certificate status: `kubectl describe certificate example-com-tls -n default`
* Confirm the Secret exists and includes `tls.crt` and `tls.key`: `kubectl get secret example-com-tls-secret -n default -o yaml`
* Troubleshoot with CertificateRequest objects and cert-manager controller logs when issuance fails.

<Callout icon="lightbulb" color="#1CB2FE">
  cert-manager stores TLS material in a Secret of type `kubernetes.io/tls` with keys `tls.crt` (certificate chain) and `tls.key` (private key). Applications should reference the Secret name so cert-manager can update the data in-place during renewal. See [cert-manager documentation](https://cert-manager.io/) and Kubernetes TLS Secret docs: `https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets`.
</Callout>

Next steps

Install cert-manager in a lab cluster, create an Issuer or ClusterIssuer and a Certificate resource, and then confirm cert-manager issues the certificate and writes the TLS Secret for your workload. For production, integrate a trusted ACME CA (e.g., Let’s Encrypt) or your organization’s internal CA, and ensure DNS or HTTP challenge solvers are configured correctly.

Links and references

* cert-manager: [https://cert-manager.io/](https://cert-manager.io/)
* Let’s Encrypt: [https://letsencrypt.org](https://letsencrypt.org)
* Kubernetes TLS Secrets: [https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets](https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/kubernetes-operators/module/b5e6237b-c98e-4357-b26a-f18c583af395/lesson/c8ea2064-681b-4291-9798-0c3840403022" />
</CardGroup>
