创建服务账户/查询访问token
# [root@etcd0 ~]# 1.创建账户
kubectl create clusterrolebinding kubelet-api-test
--clusterrole=system:kubelet-api-admin
--serviceaccount=default:kubelet-api-test
# clusterrolebinding.rbac.authorization.k8s.io/kubelet-api-test created
# [root@etcd0 ~]# 2、查询密文
SECRET=$(kubectl get secrets | grep kubelet-api-test | awk '{print $1}')
# [root@etcd0 ~]# 3、提取访问token
TOKEN=$(kubectl describe secret ${SECRET} | grep -E '^token' | awk '{print $2}')
# [root@etcd0 ~]# echo ${TOKEN}