aws-samples / eks-workshop-greater-china

AWS Workshop for Learning EKS for Greater China
MIT No Attribution
144 stars 101 forks source link

dashboard can't login #5

Open toreydai opened 4 years ago

toreydai commented 4 years ago

Kubernetes dashboard portal is ok, but i can't login with token.

liangruibupt commented 4 years ago

As document indicate, please get the login token firstly, then choice token login

获取登录的token

aws eks get-token --cluster-name ${CLUSTER_NAME} --region ${AWS_REGION} | jq -r '.status.token'

phoenixyy commented 4 years ago

I met the same issue "Kubernetes dashboard portal is ok, but i can't login with token" when using kube-proxy as a way to publish the Kubernetes dashboard service.

However, I switch to the "LoadBalancer" type of service to publish it. It works.

I suggest that maybe we could change the type to "LoadBalancer"

liangruibupt commented 4 years ago

@phoenixyy May I know your cluster is in public subnet or private subnet?

liangruibupt commented 4 years ago

I just verify again following up the https://github.com/aws-samples/eks-workshop-greater-china/blob/master/china/2020_EKS_Launch_Workshop/%E6%AD%A5%E9%AA%A43-%E9%83%A8%E7%BD%B2%E5%AE%98%E6%96%B9%E7%9A%84KubernetesDashboard.md

  1. worker node on private subnet - success login

    kubectl proxy --port=18080 --address=0.0.0.0 --disable-filter=true
    http://localhost:18080/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
    aws eks get-token --cluster-name gcr-zhy-eksworkshop-private --region cn-northwest-1 | jq -r '.status.token'
  2. worker node on public subnet - success login

    kubectl proxy --port=8080 --address=0.0.0.0 --disable-filter=true
    http://localhost:8080/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
    aws eks get-token --cluster-name gcr-zhy-eksworkshop --region cn-northwest-1 | jq -r '.status.token'

I would suggest check whether you have multiple EKS cluster

kubectl config get-contexts

If yes, please switch to right cluster context

kubectl config use-context xxxx