Error to deploy the Kubernetes Dashboard on EKS using terraform

4/16/2019

I have used the terraform to setup the EKS cluster and worker nodes, they are all working, However, when I try to deploy the K8S dashboard on the cluster by following the documentation on AWS: https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html

I got the error below when I was trying to access the localhost:8001

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "no endpoints available for service \"kubernetes-dashboard\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

When I access the pods info, this is what I got:

enter image description here

I have noticed that the Kubernetes-dashboard pod is stuck at ContainerCreating status.

I also check the K8s Dashboard pod info

Events:
  Type     Reason                  Age                      From                                  Message
  ----     ------                  ----                     ----                                  -------
  Warning  FailedCreatePodSandBox  13m (x4385 over 103m)    kubelet, ip-10-0-102-53.ec2.internal  Failed create pod sandbox: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up pod "kubernetes-dashboard-65c76f6c97-kgmmr_kube-system" network: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:50051: connect: connection refused"
  Normal   SandboxChanged          3m34s (x4880 over 103m)  kubelet, ip-10-0-102-53.ec2.internal  Pod sandbox changed, it will be killed and re-created.

I did my research about the error, it is either too old or not working in my case. Any helps plz !

-- Akira
amazon-eks
kubernetes
kubernetes-dashboard
terraform

1 Answer

4/16/2019

Your problem seems to be with the CNI. You might have to upgrade.

Please check here for the solution. https://docs.aws.amazon.com/eks/latest/userguide/cni-upgrades.html

-- vins
Source: StackOverflow