Common errors when setting up EKS for the first time

Pablo Perez
Jun 6, 2018 · 2 min read

-error Connection refused localhost:8080:

export not well done in .bash_profile, the path exported has to match the name of the config file name under .kube directory

execute kubectl config view to check if it’s actually fetching the config

-error you must be logged into the server or doesn’t have a resource type:

$ kubectl get allerror: the server doesn’t have a resource type “cronjobs”$ kubectl get nodeserror: You must be logged in to the server (Unauthorized)

check the following:

- IAM user ACCESS KEY in ~/.aws/credentials workstation where you execute kubectl commands must be the same you see in the when you describe the IAM , it must be an active ACCESS KEY. I stumbled on this and many others did.

- Check name of the cluster is the same in kubectl config file as in EKS

- Check API endpoint is set for server: and certificatedData:

- Verify you have last aws cli version

On the other hand, .kube/http-cache contains the last api invocations where you can check the api answer codes to get a more accurate insight

$ cat ~/.bash_profile
export PATH=$HOME/bin:$PATH
export KUBECONFIG=$KUBECONFIG:$HOME/.kube/config-ferpablocluster

cat ~/.kube/
cache/ config-ferpablocluster http-cache/
$ cat ~/.kube/config-ferpablocluster
apiVersion: v1
- cluster:
name: ferpablocluster
- context:
cluster: ferpablocluster
user: aws
name: aws
current-context: aws
kind: Config
preferences: {}
- name: aws
- token
- -i
- ferpablocluster
command: heptio-authenticator-aws
env: null

It’s very important to understand, that you can only use the -r flag in the kubectl config file if you have created the EKS cluster with a role. Bear in mind that if you created the EKS cluster with an IAM user the -r flag won’t work, for that use case you will need to create a config map.

- Verify kubectl version is >1.10 , previous versions didn’t support authentication plugins.

- Worker Nodes -> No Resources found

Double check name of the cluster passed to the worked nodes is the same, and that you have executed kubectl apply -f aws-auth-cm.yaml therefore you only modify the role in this yaml file with the value from the worker nodes stack NodeInstanceRole under the Outputs tab.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store