Have you getting error: exec plugin: invalid apiVersion “client.authentication.k8s.io/v1alpha1”. No worries lot of people facing same error on internet.
Above error can occurred in different scenario like
- When you configuring an EKS cluster using terraform in a private subnet and trying to access it using a VPN in a public subnet. When you configured it, it works fine but now when you run
kubectl get pods
orkubectl get svc
, it will through the error: error: exec plugin: invalid apiVersion “client.authentication.k8s.io/v1alpha1” - When you deploy deployment in
circleci
and running thekubectl cli
you will get error betweenkubectl
and the eks tool of theaws-cli
. you will get error: exec plugin: invalid apiVersion “client.authentication.k8s.io/v1alpha1” - Update kubectl from v1.23.6 to 1.24.0 and run commands
aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME} --region ${REGION}
kubectl version
you will get error: exec plugin: invalid apiVersion “client.authentication.k8s.io/v1alpha1”
How to Fix “error: exec plugin: invalid apiVersion “client.authentication.k8s.io/v1alpha1″”?
Fix 1: Downgrade the kubectl
version
Scenario:
When you configuring an EKS cluster using terraform in a private subnet and trying to access it using a VPN in a public subnet. When you configured it, it works fine but now when you run kubectl get pods
or kubectl get svc
,
Solution:
Actually its problem with kubectl
version 1.24
. So, Downgrade to 1.23.6
will fix the issue for now until it is not fixed in kubectl
version 1.24
sudo apt install kubectl=1.23.6-00
Fix 2: Update cli version
Scenario:
When you deploy deployment in circleci
and running the kubectl cli
you will get error between kubectl
and the eks tool of the aws-cli
.
or
Update kubectl from v1.23.6 to 1.24.0
Solution:
This issue is fixed in the latest version of CLI. So, make sure that you have updated your CLI version to at least 1.23.9 in v1 or 2.6.3 in v2.
You then may need to delete your ~/.kube/config
file and run aws eks update-kubeconfig --name [cluster_name]
to recreate it as mentioned here.
1. Update aws cli
2. update kub config
pip3 install awscli --upgrade --user
aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME} --region ${REGION}
Conclusion
Now, I have explained the scenario and fixes for both scenario. I am hoping above fixes resolved your issues.
Read More:
Steam Summer Sale is Live now! To Check the Steam Summer Sale Clues Answers, Click Below:
- Steam Summer Sale Clue 1 Answer
- Steam Summer Sale Clue 2 Answer
- Steam Summer Sale Clue 3 Answer
- Steam Summer Sale Clue 4 Answer
- Steam Summer Sale Clue 5 Answer
- Steam Summer Sale Clue 6 Answer
- Steam Summer Sale Clue 7 Answer
- Steam Summer Sale Clue 8 Answer
- Steam Summer Sale Clue 9 Answer
- Steam Summer Sale Clue 10 Answer