K8S安装kubernetes-dashboard
GitHub地址:https://github.com/kubernetes/dashboard
执行官方最新yaml文件
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommended.yaml
可能github官方无法访问,可以使用我的git
kubectl apply -f https://git.cnbugs.com/mrtom/kubernetes/raw/commit/2b7bf3d350e23b272f48b0fa2f6dd98ee79d52ac/kubernetes-dashboard.yaml
创建认证令牌RBAC
cat >>dashboard-admin.yaml<<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
kubectl apply -f dashboard-admin.yaml
创建集群角色
cat >> dashboard-ClusterRoleBinding.yaml <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
EOF
kubectl apply -f dashboard-ClusterRoleBinding.yaml
获取token
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
修改service的ClusterIP为NodePort
kubectl edit service kubernetes-dashboard -n kubernetes-dashboard
查看登录端口号
使用token进行登录即可
主题授权提示:请在后台主题设置-主题授权-激活主题的正版授权,授权购买:RiTheme官网
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。