issue when deploy basic auth in kubernetes dashboard

3/20/2018

I try to add a basic authentication to my kubernetes cluster by changing the file. /etc/kubernetes/manifest/kubernetes-apiserver.yaml There i add 3 flags

  • -- basic-auth-file=/etc/kubernetes/basic-auth.csv
  • -- authorization-mode=ABAC
  • -- authentication-mode=basic

But when i add those lines and i restart my system. My kubernetes freezes and won't start. Is this the right way to add flags to an already running kubernetes cluster ? Is this the right way to add basic authentication to kubernetes dashboard ?

I used this tutorial for the basic authentication: https://github.com/kubernetes/dashboard/wiki/Access-control#basic

-- achahbar
basic-authentication
dashboard
kubernetes

1 Answer

3/20/2018

Conceptually you doing everything right, but the problem is that for Modern Kubernetes version, at least for 1.9, authentication-mode is not a valid CLI flag for API server. All available flags you can check in documentation. It is a bit outdated documentation in the repo. Actually, basic authentification will be enabled when you provided basic-auth-file option.

So, just remove authentication-mode flag and use only basic-auth-file and authorization-mode. If should help.

For enable a user/password authorization, based on documentation of dashboard, you need to add authentication-mode CLI arg to a Dashboard.

-- Anton Kostenko
Source: StackOverflow