본문 바로가기

Containers/EKS

error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1" 버전 이슈

EKS에서 현재 kubectl 최신 버전(1.24.1) 사용 시 버전 문제로 아래 버전 에러 발생

(eksctl의 버전은 v0.100.0)

error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

 

Install and Set Up kubectl on Linux

Before you begin You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.24 client can communicate with v1.23, v1.24, and v1.25 control planes. Using the latest compatible version of kubectl helps avoid

kubernetes.io

 

https://github.com/aws/aws-cli/issues/6920

 

aws eks update-kubeconfig invalid apiVersion · Issue #6920 · aws/aws-cli

Describe the bug 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 I get the following error and exit st...

github.com

 

1.23.6 버전으로 kubectl을 재설치 시 정상 동작

[ec2-user@ip-172-31-26-157 .kube]$ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 44.4M  100 44.4M    0     0  30.7M      0  0:00:01  0:00:01 --:--:-- 30.7M

[ec2-user@ip-172-31-26-157 .kube]$ chmod +x ./kubectl

[ec2-user@ip-172-31-26-157 .kube]$ sudo mv ./kubectl /usr/local/bin/kubectl

[ec2-user@ip-172-31-26-157 .kube]$ kubectl get po -A
NAMESPACE     NAME                       READY   STATUS    RESTARTS   AGE
kube-system   aws-node-stf9h             1/1     Running   0          31m
kube-system   aws-node-tbjbf             1/1     Running   0          31m
kube-system   coredns-556f6dffc4-4cvcb   1/1     Running   0          40m
kube-system   coredns-556f6dffc4-v2pdg   1/1     Running   0          40m
kube-system   kube-proxy-klcrd           1/1     Running   0          31m
kube-system   kube-proxy-mr882           1/1     Running   0          31m

 

heml도 현재 최신 버전(3.9.0) 사용 시 아래와 같은 버전 에러 발생
Error: INSTALLATION FAILED: Kubernetes cluster unreachable: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

 

3.8.2 버전으로 롤백 시 정상 동작

[ec2-user@ip-172-31-26-157 ~]$ curl -L https://git.io/get_helm.sh | bash -s -- --version v3.8.2

 

태그