I've seen this error in many previous questions, but as a complete beginner I'm not sure if those questions were relevant to my situation.
I've created a cluster called wiz_try using the AWS EKS gui. When it asked for a role, I've created a new one with EKS policy AmazonEKSClusterPolicy.
I've download AWS ICL and configured it. Also downloaded Kubectl.
checked that I see the cluster:
aws eks --region eu-central-1 describe-cluster --name wiz_try --query cluster.status
ACTIVE
- ran
aws eks update-kubeconfig --name wiz_try --region eu-central-1
this has created a config file:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: *******
server: https://***.gr7.eu-central-1.eks.amazonaws.com
name: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
contexts:
- context:
cluster: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
user: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
name: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
current-context: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
kind: Config
preferences: {}
users:
- name: arn:aws:eks:eu-central-1:399222411859:cluster/wiz_try
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- eu-central-1
- eks
- get-token
- --cluster-name
- wiz_try
command: aws
kubectl get svc
error: You must be logged in to the server (Unauthorized)
I tried solving by running
aws eks update-kubeconfig --name wiz_try --region eu-central-1 --role-arn arn:aws:iam::***:role/EKS_cluster_role
as this is the role I created, but this is not helping.
what am I missing?
Thanks