k8s dashboard 搭建
2020-10-26 本文已影响0人
草帽路飞S
令牌:
创建kubernetes-dashboard管理员角色
================================================
apiVersion: v1
kind: ServiceAccount
metadata:
name: dashboard-admin
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: dashboard-admin
subjects:
- kind: ServiceAccount
name: dashboard-admin
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
================================================
~]# kubectl create -f k8s-admin.yaml
获取dashboard管理员角色token:
~]# kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}')