The Issue
After moving my life over to a new Macbook and installing the latest AWS CLI tools including “aws-iam-authenticator” tool, I couldn’t run commands against my EKS Clusters. I kept hitting the following issue;
> kubectl get pods Unable to connect to the server: getting credentials: exec plugin is configured to use API version client.authentication.k8s.io/v1alpha1, plugin returned version client.authentication.k8s.io/v1beta1
The Cause
AWS updated the aws-iam-authenicator component in version 0.5.4 to require v1beta1 your kubeconfig file for the cluster context. You will be using v1alpha1 more than likely, which generates this error.
The Fix
Update your kubeconfig file as necessary, replacing “v1alpha1” for “v1beta1” for any contexts for EKS clusters.
vi ~/.kube/config # Alernatively you could run something like the below to automate the changes. This will also create a "config.bak" file of the orignal file before the changes sed -i .bak -e 's/v1alpha1/v1beta1/' ~/.kube/config
Below you can see I used the “sed” command, checked my file using “vi” then run the kubectl command successfully.
Official GitHub Page
Regards