首页 > 其他分享 >Dashboard部署

Dashboard部署

时间:2022-11-13 18:49:51浏览次数:58  
标签:kubectl name kubernetes dashboard 部署 admin user Dashboard

官网

https://kubernetes.io/zh-cn/docs/tasks/access-application-cluster/web-ui-dashboard/
image

一、下载资源清单文件

  • 上述官网提供的地址无法访问,所以无法直接部署
#官方给的地址
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yaml

二、安装

kubectl apply -f recommend.yaml
image

三、访问

image

四、创建dashboard服务账号

官网介绍:https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

image

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard

---
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

获取token

image

kubectl create token admin-user -n kubernetes-dashboard

image

清理操作

  • 删除ServiceAccount
    kubectl delete serviceaccount admin-user -n kubernetes-dashboard

  • 删除ClusterRoleBinding
    kubectl delete clusterrolebinding admin-user -n kubernetes-dashboard

标签:kubectl,name,kubernetes,dashboard,部署,admin,user,Dashboard
From: https://www.cnblogs.com/bangbangzoutianya/p/16885907.html

相关文章