0Pricing
Docker & Kubernetes for Developers · Lección

Terminación de TLS y protección del Ingress con HTTPS

Sirva tráfico mediante HTTPS configurando TLS en su Ingress, almacenando los certificados como Secrets y automatizando su emisión con cert-manager.

Terminación de TLS y protección del Ingress con HTTPS es una lección gratuita de Docker & Kubernetes for Developers en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Docker & Kubernetes for Developers, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Docker & Kubernetes for Developers incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Why TLS at the Ingress

Terminating TLS at the Ingress lets one place handle HTTPS for many backend services, so internal apps can stay plain HTTP while users get encryption.

Certificates Live in Secrets

An Ingress references a TLS certificate stored in a Kubernetes Secret of type kubernetes.io/tls, holding a tls.crt and tls.key.

kubectl create secret tls my-tls \
  --cert=tls.crt --key=tls.key

Adding a tls Block to Ingress

The spec.tls section maps hostnames to the secret that secures them.

spec:
  tls:
    - hosts:
        - app.example.com
      secretName: my-tls
  rules:
    - host: app.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web
                port:
                  number: 80

How Termination Works

The Ingress controller decrypts incoming HTTPS, then forwards plain HTTP to the backend Service inside the cluster network.

The Certificate Renewal Problem

Certificates expire. Renewing and re-uploading them by hand is error prone, which is why automation tools exist.

Introducing cert-manager

cert-manager is an add-on that watches Ingress/Certificate resources and automatically obtains and renews certificates from issuers like Let us Encrypt.

Defining a ClusterIssuer

A ClusterIssuer tells cert-manager how to get certificates cluster-wide.

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
    solvers:
      - http01:
          ingress:
            class: nginx

Annotating the Ingress

Add an annotation so cert-manager issues a cert and stores it in the named secret automatically.

metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod

HTTP-01 vs DNS-01

HTTP-01 proves domain ownership by serving a token over HTTP; DNS-01 proves it via a DNS TXT record and supports wildcard certificates.

Forcing HTTPS Redirects

Most controllers redirect HTTP to HTTPS by default. With NGINX you can control it via an annotation.

metadata:
  annotations:
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"

Verifying the Certificate

Check the Certificate resource and inspect the served cert.

kubectl get certificate
openssl s_client -connect app.example.com:443

Quick Check

Test what you have learned.

Recap

You learned to terminate TLS at the Ingress using a tls Secret, automate issuance and renewal with cert-manager and a ClusterIssuer, choose HTTP-01 vs DNS-01, and force HTTPS redirects.

Preguntas frecuentes

¿La lección «Terminación de TLS y protección del Ingress con HTTPS» es gratis?

Sí — el texto completo de «Terminación de TLS y protección del Ingress con HTTPS» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Docker & Kubernetes for Developers, actualiza a CoddyKit PRO. El curso de Docker & Kubernetes for Developers incluye 4 lecciones en total.

¿Qué aprenderé en «Terminación de TLS y protección del Ingress con HTTPS»?

Sirva tráfico mediante HTTPS configurando TLS en su Ingress, almacenando los certificados como Secrets y automatizando su emisión con cert-manager. Practicas Docker & Kubernetes for Developers con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar Docker & Kubernetes for Developers?

No se requiere experiencia previa. Docker & Kubernetes for Developers en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.

¿Cuánto tiempo toma la lección «Terminación de TLS y protección del Ingress con HTTPS»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de Docker & Kubernetes for Developers?

Sí. Cada lección de Docker & Kubernetes for Developers incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Ingress y enrutamiento en Kubernetes
  2. Implementación de Network Policies
  3. Descubrimiento de servicios y DNS en K8s
  4. Terminación de TLS y protección del Ingress con HTTPS
← Volver a Docker & Kubernetes for Developers