Kubernetes 1.6+ RBAC: Gain access as role cluster-admin via kubectl

6/12/2017

1.6+ sees a lot of changes revolving around RBAC and ABAC. However, what is a little quirky is not being able to access the dashboard etc. by default as previously possible.

Access will result in

User "system:anonymous" cannot proxy services in the namespace "kube-system".: "No policy matched."

Documentation at the k8s docs is plenty, but not really stating how to gain access practically, as creator of a cluster, to become cluster-admin

What is a practical way to authenticate me as cluster-admin?

-- eljefedelrodeodeljefe
kubernetes

1 Answer

6/12/2017

By far the easiest method is to use the credentials​ from /etc/kubernetes/admin.conf (this is on your master if you used kubeadm) . Run kubectl proxy --kubeconfig=admin.conf on your client and then you can visit http://127.0.0.1:8001/ui from your browser.

You might need to change the master address in admin.conf after you copied to you client machine.

-- Janos Lenart
Source: StackOverflow