mirror of https://github.com/easzlab/kubeasz.git
fix: get secret tokens for dashboard login in v1.24
parent
356a98ed48
commit
86e6f08158
|
@ -48,7 +48,7 @@ kubectl logs -n kube-system kubernetes-dashboard-698d4c759b-67gzg
|
|||
|
||||
``` bash
|
||||
# 获取 Bearer Token,找到输出中 ‘token:’ 开头的后面部分
|
||||
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
|
||||
$ kubectl describe -n kube-system secrets admin-user
|
||||
```
|
||||
|
||||
- Token令牌方式登录(只读)
|
||||
|
@ -57,7 +57,7 @@ $ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | g
|
|||
|
||||
``` bash
|
||||
# 获取 Bearer Token,找到输出中 ‘token:’ 开头的后面部分
|
||||
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep read-user | awk '{print $1}')
|
||||
$ kubectl describe -n kube-system secrets dashboard-read-user
|
||||
```
|
||||
|
||||
- Kubeconfig登录(admin)
|
||||
|
|
|
@ -18,3 +18,12 @@ subjects:
|
|||
name: admin-user
|
||||
namespace: kube-system
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: kubernetes.io/service-account-token
|
||||
metadata:
|
||||
name: admin-user
|
||||
namespace: kube-system
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: "admin-user"
|
||||
|
|
|
@ -163,3 +163,13 @@ rules:
|
|||
- get
|
||||
- list
|
||||
- watch
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: kubernetes.io/service-account-token
|
||||
metadata:
|
||||
name: dashboard-read-user
|
||||
namespace: kube-system
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: "dashboard-read-user"
|
||||
|
|
Loading…
Reference in New Issue