Troubleshooting an eksctl 'no cluster found' region mismatch

2024-06-19 2 min read Troubleshooting Barny Baron

Journey: 📊 Community Builder 📊

Subject matter: 💡 Troubleshooting 💡

Task: Troubleshooting an eksctl “no cluster found” region mismatch

While working on this project I ran into a problem that needed troubleshooting and thought I would share it.

Troubleshooting

Problem observed:

I was attempting to perform an eksctl utils command to associate an IAM OIDC provider but it was failing with an error: “ResourceNotFoundException: No cluster found for name”

Click to enlarge: OIDC error

The eksctl get clusters command was showing error: “No clusters found”

No Clusters Found

However, when checking my EKS cluster in the Management Console, I cound see it no problem:

Cluster online

I checked the pods and could see these online, and when I specified the region in my get clusters command it could see the cluster ok:

eksctl get clusters –region

Healthy cluster

Fix required:

The aws configured “default region” was set incorrectly in aws.configure. My default region was set as a different region to the target EKS cluster region in my project, therefore my AWS CLI was looking for the EKS cluster in the wrong place.

I opened the aws configuration file with command: .aws/config

This opened a new notepad window which showed me the following:

Default region

I then returned to my management console and confirmed that my EKS cluster was running in region US-East-1.

I amended the default region and saved the file:

Update default region

I was then able to run the get clusters command successfully:

Cluster found

After my cluster could be observed, I then issued the OIDC association request and it worked:

OIDC associate success

Articles that helped overcome the issue:

https://stackoverflow.com/questions/62342808/eksctl-no-clusters-found

https://stackoverflow.com/questions/56782637/best-way-to-seed-new-machine-with-k8s-eks-info

https://medium.com/pablo-perez/common-errors-when-setting-up-eks-for-the-first-time-a43cbf989a2e

If this post helps just one other person, it has served its purpose well!

Cloud