nginx.ingress annotations not working for basic authentication in Kubernetes

11/20/2018

I am trying to setup basic authentication on Kubernetes but the IP I obtain after setting up authentication using the nginx.ingress annotations is still publicly accessible. Below is the link I referred to in setting this up-

https://blog.bigbinary.com/2018/08/14/using-kubernetes-ingress-authentication.html

After following the process in the link, I should be prompted to enter the username and password when I hit that IP but instead I'm able to access it without any authentication.

-- Ben Abey
google-kubernetes-engine
kubernetes
nginx

1 Answer

11/26/2018

I would recommend following this link which shows how to add authentication specific to GKE.

You can deploy an nginx ingress controller in your GKE cluster. Please make sure to annotate your ingress to avoid the GLBC claiming the ingress as specified in this link. Then you can expose the nginx controller directly, or create a glbc ingress to redirect traffic to the nginx ingress as specified in this link.

-- John Mathew
Source: StackOverflow