could not get token AccessDenied Access denied

0 votes

Hi Guys,

I have created my EKS Cluster. But it is not supporting kubectl command. It gives me the below error.

$ kubectl get pods
could not get token: AccessDenied: Access denied

How can I solve this error?

Jul 9, 2020 in AWS by akhtar
• 38,260 points
1,350 views

1 answer to this question.

0 votes

Hi@akhtar,

You may get this error if your Kubectl is not configured properly for Amazon EKS or the IAM user or role credentials that you are using do not map to a Kubernetes RBAC user with sufficient permissions in your Amazon EKS cluster. If you assumed a role to create the Amazon EKS cluster, you must ensure that Kubectl is configured to the same role. Use the following command to update your kubeconfig file to use an IAM role.

$ aws --region region-code eks update-kubeconfig --name cluster_name --role-arn arn:aws:iam::aws_account_id:role/role_name

I hope this will solve your error.

answered Jul 9, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer

Why I get AWS repository ARN could not be added to restrict access?

heh... answer my own question: I must ...READ MORE

answered Sep 21, 2018 in AWS by Priyaj
• 58,020 points
844 views
+5 votes
2 answers

AWS EC2 Instances are not getting to internet access

Check your VPC settings, whether you are ...READ MORE

answered Oct 16, 2018 in AWS by Omkar
• 69,220 points
13,330 views
+1 vote
2 answers
+1 vote
2 answers

AWS CloudWatch Logs in Docker

The awslogs works without using ECS. you need to configure ...READ MORE

answered Sep 7, 2018 in AWS by bug_seeker
• 15,510 points
2,064 views
0 votes
1 answer
0 votes
1 answer

An error occurred (AccessDenied) when calling the CreateBucket operation: Access Denied

Hi@akhtar, You are getting this error because your ...READ MORE

answered Oct 7, 2020 in AWS by MD
• 95,460 points
4,939 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP