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>
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>
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
Might be null value set as following so you are getting this error:-
apiVersion: v1
clusters: null
contexts: null
current-context: ""
kind: Config
preferences: {}
users: null
run > $HOME/.kube/config
will empty exist .kube/config file and then run again following cmd
aws eks update-kubeconfig --region us-east-2 --name <cluster name>
Run: kubectl config get-contexts.
If you see your cluster, run: kubectl config use-context <cluster_name>.
If you see your cluster, run: cat ~/.kube/config
if you see something like:
apiVersion: v1 clusters: null contexts: null current-context: "" kind: Config preferences: {} users: null
Run: rm ~/.kube/config. It deletes your ~/.kube/config.
Then run: aws eks update-kubeconfig --name <cluster_name> --region <cluster_region>. It creates ~/.kube/config.
Run kubectl config current-context to see your context. End.
!!! Be sure you are in the right account: aws sts get-caller-identity.
This "not iterable" error has happened to me before when I was in a sub-account of a main account. Switching your aws identity to the parent account made the "not iterable" error go away, so the command could complete properly.
© 2022 - 2024 — McMap. All rights reserved.
--debug
please? – Bering