CKS Security Quest · Ingress TLS

Secure an existing route

Inspect the certificate, create the Secret, and add TLS without breaking routing.

CKS-0096 minutes

Supplied files

/opt/certs/store.crt
/opt/certs/store.key

Complete existing Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: storefront
  namespace: shop
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: store.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: storefront
            port:
              number: 80