目录
2.get token and sa from secret
1.create serviceaccount
# 创建一个服务账号
在k8s中创建serviceaccount成功后,同步创建出对应的secret,secret存储了token和证书信息。
2.get token and sa from secret
# 根据sa name找到对应的secret name
# 直接依据secret name 找到token和CA证书信息(后续创建user需要使用)
# 找到TOKEN
# 找到CA
3.add cluster
# create SA file
# config a new cluster
serverpath需要在k8s集群上查看,格式是http://k8s-cluster-host:port
# add user
# add context
4.check configuration
最后这一步是验证配置是否生效的操作,本质是一个查询操作。
5.refer to
k8s之serviceaccount,登录账号创建 - SZ_文彬 - 博客园