configuration
aws eks --region us-east-1 update-kubeconfig --name app-cluster
~ kubectl get svc
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
~ kubectl version
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
~ kubectl version --client
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
The version of kubectl in the eks cluster is 1.29
The EKS cluster was created vio eksctl
This issue faced me before, It took two days to troubleshoot. Please check the following:
1- your kubectl version is compatible with Kubernetes version. In your case it looks good.
2- the aws cli version is the usually the reason, Upgrade the version of aws cli to latest version, run the command again and it should work. An issue related to yours might help you as well.
If you're using a user that is different From the one that created the cluster, Ensure that your IAM exists in aws auth configmap, this article might help you