Interview Prep/Real-World Interview/DNS, TLS and certificates

Users get a certificate warning, and the browser shows the cert is "Kubernetes Ingress Controller Fake Certificate".

BeginnerTroubleshootingDNS, TLS and certificates
Answer

Likely causes → ingress-nginx couldn't find a valid TLS secret for that host, so it served its built-in default cert. Usually the Secret named in spec.tls[].secretName doesn't exist, is in a different namespace, is malformed, or the host in tls.hosts doesn't match the rule.

Diagnose →

kubectl get ingress app -n prod -o jsonpath='{.spec.tls}'
kubectl get secret app-tls -n prod
kubectl -n ingress-nginx logs deploy/ingress-nginx-controller | grep -i 'ssl certificate\|secret'

Fix → Create the Secret in the same namespace as the Ingress (type kubernetes.io/tls, with tls.crt and tls.key) and make tls.hosts match the rule hosts exactly.

Prevent → Let cert-manager create the Secret via the Ingress annotation, and alert on the controller's nginx_ingress_controller_ssl_expire_time_seconds metric.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates