How do I log in to kubernetes-cockpit UI if .kube/config contains a token instead of an account?

8/4/2017

Numerous forum posts and documentations specify extracting login info for the Kubernetes install from ~/.kube/config.

The problem I found: mine doesn't have a proper user account, it specifies a name and a token.

How do I get the account name so I can use the kubernetes-cockpit UI? Surprisingly there appears to be nothing on that topic - what to do if the config doesn't contain an account.

-- user1258361
kubernetes

1 Answer

8/17/2017

It depends on how you use Cockpit. According to cockpit official page:

Used in a standard cockpit session:

If a user is able to use kubectl successfully when at their shell terminal, then that same user will able to use Kubernetes dashboard when logged into Cockpit

I suppose this is your scenario, so if you didn't change default settings, the cockpit will look for .kube/config itself, i.e. you should be able to login without specifying your account.

-- Ken Chen
Source: StackOverflow