kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml

    kubectl apply -f recommended.yaml

    spec: type: NodePort ports:

    1. - port: 443
    2. targetPort: 8443
    3. nodePort: 30001

    selector: k8s-app: kubernetes-dashboard

    访问
    https://ip:30001

    创建token,在master节点
    kubectl create serviceaccount dashboard-admin -n kube-system

    kubectl create clusterrolebinding dashboard-admin \
    —clusterrole=cluster-admin \
    —serviceaccount=kube-system:dashboard-admin

    获取token的命令
    kubectl describe secrets -n kube-system $(kubectl -n kube-system get secret |awk ‘/dashboard-admin/{print $1}’)