1、找到deploy
kubectl get deploy -n kubernetes-dashboard
2、打开deploy的yaml文件并加入dashboard的token过期时间
kubectl edit deploy kubernetes-dashboard -n kubernetes-dashboard
#加入如下启动参数,标红的
spec:
containers:
- args:
- --auto-generate-certificates
- --namespace=kubernetes-dashboard
- --token-ttl=43200