snap商店安装microk8s
如果snap商店版本太低  升级命令 snap refresh

sudo snap install microk8s --classic

由于microk8s部分镜像无法直接下载，需要翻墙或本地导入。下面我们采取本地导入的方式。
执行 fetch-images.sh

microk8s status --wait-ready

添加可视化组件dashboard
microk8s enable dashboard

If RBAC is not enabled access the dashboard using the default token retrieved with:
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
microk8s kubectl -n kube-system describe secret $token
In an RBAC enabled setup (microk8s enable RBAC) you need to create a user with restricted
permissions as shown in:
https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

输入指令

ca.crt:     1103 bytes
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IjhBZkhHamJTbTdVbkZTbXB6OTJ5ek9BMWhEcjdmSjV0QjNZTVFPb2pxS0EifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkZWZhdWx0LXRva2VuLTl3ZmNiIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImRlZmF1bHQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJiNGY4MTE1Ni0yZmMxLTRkYjUtYWEzMC0zYWNjNjU3MDFkMzYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06ZGVmYXVsdCJ9.riZGi-pIdWUUEafjrmXFRh5VPHiNt-jVsrGpwkMzBSu61B1KzW_tU0JLUqe3uIljeDT3hxyYz6liC5Ybc0tJJgg86tuhbquOvVoCHhOjU8dXpuN9dhh6rKlMxmi67uhoZISfltTOZLsYZitA2sWthh5SEiQx4uqYmo7XoRVjUU0CHFuQhp2fABDCLDdcvyr7_sIsAjda2abiE4FG4jOoCpquXGAwIQmRwgFz58NXdricHjJ80of9q85SD7tdlLKD491Rsq9pHW_wNjOsoCvJx1YQZqIgL8qaXAyD0me2EOI3YpqN2I7FWJQJ6DpQ2yzGOhqPqIRFmNr51PQiq7c3og

添加别名
alias kubectl='microk8s.kubectl'

安装完成后检查一下，是否所有的Pod都成功启动了： microk8s kubectl get pods -A
都成功启动，则显示如下图，如有Image下载失败，可参照注释部分，手动下载。

microk8s kubectl get pods -A

我们搞个代理
microk8s.kubectl proxy
这里要注意 如果是需要外面机器访问 需要 
 microk8s.kubectl proxy --address='0.0.0.0'
注意，如果是外部机器，完整的需要是
microk8s.kubectl proxy --address='0.0.0.0' --accept-hosts='^*$'

现在就可以通过 http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ 来访问Dashborad UI了

输入我们之前保存的token 可以搞了哈
进去了