- Newest
- Most votes
- Most comments
The error you're encountering when running 'kubectl get nodes' is related to an authentication issue between your local kubectl configuration and the EKS cluster. This is a common problem that can occur even when the cluster is up and running in the AWS console. Here are some steps to resolve this issue:
-
Ensure you have the latest version of the AWS CLI installed. You may need to upgrade to AWS CLI version 2 if you're still using version 1.
-
Update your kubeconfig file to properly authenticate with your EKS cluster. Run the following command, replacing the placeholders with your actual cluster name and region:
aws eks update-kubeconfig --name <your-cluster-name> --region <your-region>
-
If you're still experiencing issues, check that your IAM user or role has the necessary permissions to access the EKS cluster. Make sure you have the proper IAM policies attached that allow EKS access.
-
Verify that the AWS CLI is using the correct credentials. You can check this by running 'aws sts get-caller-identity' to see which IAM entity you're currently using.
-
If you're using any kubectl plugins or custom configurations, ensure they are compatible with your EKS version.
-
As a troubleshooting step, you can try to remove the existing kubeconfig file for your cluster and regenerate it using the 'aws eks update-kubeconfig' command mentioned earlier.
If these steps don't resolve the issue, you may need to check for more specific error messages by running 'kubectl get nodes --v=9' for verbose output, which can provide more detailed information about the authentication failure.
Sources
EKS doesnt start getting Kubernetes version on EKS cluster: error running kubectl version: exit status 1 (check 'kubectl version') | AWS re:Post
Kubectl describe nodes command fails with E0422 | AWS re:Post
answered 2 years ago
Hello Rishabh,
From the screenshot error shared, it looks like you are having a communication issue from the client to the EKS API Server. As you described, it looks like the cluster is working fine but the issue is only at the kubectl side.
The client should be able to reach out the Kubernetes API Server to run Kubectl commands. The IP showing on the error looks like from an internal VPC CIDR block. This is expected if you are using a private EKS cluster. However, you should use a client from inside the same VPC to be able to run the kubectl commands.
Double check that to see if you can overcome this issue. Hope this helps you.
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
