安装dashboard

    1. $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml

    开启本地访问:

    1. $ kubectl proxy

    开启外部访问:

    1. $ kubectl proxy --address='0.0.0.0' --accept-hosts='^*$'

    访问地址:
    http://ip:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
    获取token

    1. # 创建 ServiceAccount kubernetes-dashboard-admin 并绑定集群管理员权限
    2. $ kubectl apply -f https://raw.githubusercontent.com/gotok8s/gotok8s/master/dashboard-admin.yaml
    3. # 获取登陆 token
    4. $ kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep kubernetes-dashboard-admin | awk '{print $1}')

    如果提示:
    image.png
    就自己绑定一个ip 反代到上面到ip:port上 就可以访问了