Question
There is a way to create a service account and get token as in How to Add Users to Kubernetes (kubectl)? but is there a way to get or create a token for a normal user?
Background
Followed Configure RBAC In Your Kubernetes Cluster and created a normal user.
Bind a cluster role to the user as below (not sure this is correct, appreciate suggestions). I would like to create a token for the user and use it to access the dashboard but do not know how to do.
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: kube-system
name: dashboard-admin-role
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "list", "watch"]
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: dashboard-admin-rolebinding
namespace: office
subjects:
- kind: User
name: myuser
apiGroup: "rbac.authorization.k8s.io"
roleRef:
kind: ClusterRole
name: dashboard-admin-role
apiGroup: "rbac.authorization.k8s.io"