ingress-nginx: Using default-tls-certificate & watch-namespace does not work if secret is not in watched namespace

What happened:

Using the combination of watch-namespace and default-tls-certificate flag leads to an error loading the default-tls-certificate if the certificate is not in the namespace that is watched.

7 controller.go:1102] 
Error loading custom default certificate, falling back to generated default: 
local SSL certificate ingress-namespace/default-tls-certificate was not found

My best guess is that the store used to access the configuration is scoped to the namespace and does not allow “escaping” this (which is good during runtime from a security perspective).

What you expected to happen:

Either state in in the documentation that default-tls-certificate needs to be within watch-namespace(s) if configured or maybe better allow the default-tls-certificate to be stored in another namespace (as it might be unintended that the secret is accessible by the watched namespace’s operators and apps).

NGINX Ingress controller version: >= 1.1.1 Kubernetes version: >= 1.23

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

We have the same problem and we’re not using watch-namespace or watch-namespace-selector. The secret in in the ingress NS and I made sure the SA can get it, still not found…