<p>I am setting up a secret containing the certificate for ingress controller but getting the below error when I check the ingress logs</p>
<p>Ingress logs:</p>
<pre><code>W0304 05:47:32.020497       7 controller.go:1153] Error getting SSL certificate &quot;default/auth-tls&quot;: local SSL certificate default/auth-tls was not found. Using default certificate
W0304 05:47:32.020516       7 controller.go:1407] Error getting SSL certificate &quot;default/auth-tls&quot;: local SSL certificate default/auth-tls was not found
I0304 05:47:32.114777       7 main.go:117] &quot;successfully validated configuration, accepting&quot; ingress=&quot;hello-kubernetes-ingress&quot; namespace=&quot;default&quot;
</code></pre>
<p>Secret:</p>
<pre><code>$ kubectl create secret tls auth-tls --cert key.pem --key out.key
$ kubectl describe secret auth-tls
Name:         auth-tls
Namespace:    default
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;

Type:  kubernetes.io/tls

Data
====
tls.crt:  3231 bytes
tls.key:  1732 bytes
</code></pre>
<p>Below is my yaml file for ingress</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: hello-kubernetes-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/auth-url: https://externalauthentication/authorize
spec:
  rules:
  - host: hw1.yourdomain
    http:
      paths:
      - backend:
          serviceName: hello-kubernetes-first
          servicePort: 80
  - host: hw2.yourdomain
    http:
      paths:
      - backend:
          serviceName: hello-kubernetes-second
          servicePort: 80
  tls:
  - hosts:
    - externalauthentication
    - hw1.yourdomain
    secretName: auth-tls
</code></pre>

<p>Both the <code>Ingress</code> and the <code>Secret</code> are namespaced resources. You can check yourself with:</p>
<pre><code>$ kubectl api-resources --namespaced=true
NAME                        SHORTNAMES   APIGROUP                    NAMESPACED   KIND
...
secrets                                                              true         Secret
...
ingresses                   ing          extensions                  true         Ingress
ingresses                   ing          networking.k8s.io           true         Ingress
</code></pre>
<p>They can only work within their <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">namespace</a>. So in your use case you need to put both of them (<code>Ingress</code> and <code>Secret</code>) in the same namespace.</p>
