k8s-1.18.x创建dashboard管理员token

k8s-1.18.x创建dashboard管理员账号token,创建create-admin.yaml文件

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

下载metrics-server-v3.7.yaml文件(https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml)

###需etcd监控使用
###kubectl -n monitoring create secret generic etcd-certs --from-file=/etc/kubernetes/pki/etcd/healthcheck-client.crt --from-file=/etc/kubernetes/pki/etcd/healthcheck-client.key --from-file=/etc/kubernetes/pki/etcd/ca.crt
kubectl apply -f metrics-server-v3.7.yaml
kubectl create namespace kubernetes-dashboard
kubectl create secret generic kubernetes-dashboard-certs --from-file=/opt/ssl -n kubernetes-dashboard
kubectl apply -f kubernetes-dashboard.yaml
kubectl apply -f create-admin.yaml
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')

给TA买糖
共{{data.count}}人
人已赞赏
k8s编排文件

创建k8s单独命名空间token账号

2021-5-18 10:38:17

安装脚本

Centos8下rpm包安装mysql-5.7.31

2021-5-21 16:20:52

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索