fix dashboard rights error

pull/195/head
simon 3 years ago
parent 7c6907b945
commit b663af15f7

@ -146,9 +146,11 @@ http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kube
对于Mac环境
```shell
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN
kubectl apply -f mac/sa.yaml,mac/crb.yaml
#TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
#kubectl config set-credentials docker-desktop --token="${TOKEN}"
#echo $TOKEN
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
```
对于Windows环境

@ -0,0 +1,12 @@
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

@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
Loading…
Cancel
Save