Connecting to existing EKS cluster using kubectl or eksctl

Tuhin Subhra Mandal picture Tuhin Subhra Mandal · May 3, 2020 · Viewed 7.2k times · Source

I have created one kubernetes cluster on EKS. I used eksctl create cluster to create the cluster. I am able to access everything which is great.

However, my colleague has created another cluster, and I am wondering how will I generate / get Kubeconfigs so that I can point to the cluster that my colleague has created.

Answer

Chinmaya Biswal picture Chinmaya Biswal · Aug 12, 2020

There are 2 ways you can get the kubeconfig.

  1. aws eks update-kubeconfig --name <clustername> --region <region>
  2. eksctl utils write-kubeconfig --cluster=<clustername>

Provided you have the EKS on the same account and visible to you.

Once you get the kubeconfig, if you have the access, then you can start using kubectl.

If you don't have access, you need to ask the owner to give your userID permissions to the cluster.

Complete details are listed here