EKS update config with awscli command "aws eks update-kubeconfig" fails with error "'NoneType' object is not iterable"

Viewed 3254

When running following command to update kubernetes config to get connected with EKS cluster then getting this error "'NoneType' object is not iterable"

aws eks update-kubeconfig --region us-east-2 --name <cluster name>
1 Answers

Do you have an existing k8s config? Running

aws eks update-kubeconfig --region <region> --name <cluster name>

Generates a ~/.kube/config.

If you already have a ~/.kube/config, there could be a conflict between the file to be generated, and the file that already exists that prevents them from being merged.

If you have a ~/.kube/config file, and you aren't actively using it, running

rm ~/.kube/config

and then attempting

aws eks update-kubeconfig --region us-east-2 --name <cluster name>

afterwards will likely solve your issue.

If you are using your ~/.kube/config file, rename it something else so you could use it later, and then run the eks command again.

See a similar issue here: https://github.com/aws/aws-cli/issues/4843

Related