Please update your awscli to 2.6.3
In v1.24.0, kubectl
will report the following error when relying on the kubeconfig generated by aws-cli
> error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
The reason is that Kubernetes deprecated client.authentication.k8s.io/v1alpha1"
from the exec
plugin in PR108616
And the aws-cli update PR6476 has not been merged. There are two solutions
1. Roll back kubectl to any version less than v1.24.0
2. Take MacOS + HomeBrew as an example:
1. Modify "client.authentication.k8s.io/v1alpha1" in your kubeconfig to "client.authentication.k8s.io/v1beta1"
2. Put "client.authentication.k8s.io/ in /usr/local/Cellar/awscli/{awscliVersion}/libexec/lib/python3.9/site-packages/awscli/customizations/eks/get_token.py
v1alpha1" changed to "client.authentication.k8s.io/v1beta1"
I have been facing this issue from past few days and I had a temp workaround. This worked perfectly fine now.