<p>According to the Kubernetes docs, the Nginx Ingress Controller supports adding basic authentication. The required Ingress annotations that I'm setting are:</p>

<pre><code>nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: namespace/secret
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"
</code></pre>

<p>My ingress controller image is: gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.11</p>

<p>I cannot find any logs from the ingress controller that would indicate errors, but basic auth is not present. In case it matters, I am using cert-manager to provision Let's Encrypt TLS certificates, which is working nicely.</p>

mwcoop17
<p>You are using wrong controller/annotations. These annotations are for <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx</a> which has this official <a href="https://quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.17.1" rel="nofollow noreferrer">image</a></p>

<p>You have examples of how to deploy the controller <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/mandatory.yaml" rel="nofollow noreferrer">here</a>  </p>

<p>If you want to use gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.11, the annotations are:</p>

<pre><code>ingress.kubernetes.io/auth-type: basic
ingress.kubernetes.io/auth-secret: basic-auth
ingress.kubernetes.io/auth-realm: "Authentication Required"
</code></pre>
