我使用 Rocky Linux 8 并通过 Snap 安装了 micro8ks。我尝试根据此文档启用 microk8s 的仪表板:
https://microk8s.io/docs/addon-dashboard
microk8s enable dashboard
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s kubectl -n kube-system describe secret $token
但最后一个命令不会打印出任何令牌。它给出了这个:
Name: kubernetes-dashboard-certs
Namespace: kube-system
Labels: k8s-app=kubernetes-dashboard
Annotations: <none>
Type: Opaque
Data
====
Name: kubernetes-dashboard-csrf
Namespace: kube-system
Labels: k8s-app=kubernetes-dashboard
Annotations: <none>
Type: Opaque
Data
====
csrf: 256 bytes
Name: kubernetes-dashboard-key-holder
Namespace: kube-system
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
priv: 1679 bytes
pub: 459 bytes
我缺少什么?
答案1
似乎在 kubernetes 1.24 版本中,服务帐户的令牌不再自动生成。