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 in AWS by akhtar
• 17,690 points
37 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 by MD
• 40,740 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
• 57,550 points
81 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,040 points
5,167 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 6, 2018 in AWS by bug_seeker
• 15,400 points
687 views
0 votes
1 answer