Enable Basic Auth in Kubernetes

8/5/2018

I have minikube installation on my machine for some testing that requires Basic Auth,

How can I enable it for all services I'll create in future?

-- kagarlickij
basic-authentication
kubernetes

1 Answer

8/5/2018

If you mean for the Kubernetes API services then that can be enabled in minikube with a CSV file - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-password-file

(though some seem to have found this tricky on Windows https://github.com/kubernetes/minikube/issues/1898 ).

If you mean for services you are writing and deploying to Kubernetes then I think that's not something that the Kubernetes platform would currently provide for you out of the box.

It would be open to you to use an authentication feature in an ingress controller (the nginx one for example) or to use Istio or, depending on your use-case, you might well choose to do it in your code.

-- Ryan Dawson
Source: StackOverflow