4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

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

Posted at

What's This

以下コマンドを実行しようとしたら、表題のエラー。
解決のメモです。

$ aws eks --region ap-northeast-1 update-kubeconfig --name "Cluster Name"

$ kubectl get svc
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

AWS CLIのバージョンアップ

aws --version
aws-cli/2.1.31 Python/3.8.8 Darwin/20.6.0 exe/x86_64 prompt/off

以下からGUIで最新をインストール

aws --version
aws-cli/2.7.19 Python/3.9.11 Darwin/20.6.0 exe/x86_64 prompt/off

冒頭のコマンドを再度実行

$ aws eks --region ap-northeast-1 update-kubeconfig --name "Cluster Name"
Updated context arn:aws:eks:ap-northeast-1:"AWS Account ID":cluster/"Cluster Name" in /Users/"User Name"/.kube/config

$ kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   hogehoge     <none>        443/TCP   66m

コマンドが通りました。

Conclusion

調べたところ、AWS CLIを最新にアップグレードするか、kubectlバージョンをダウングレードするか、の2つの解決方法があるっぽいですね。
前者の方がすぐ解決できそうだったので前者にしました。

Reference

https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/
https://github.com/aws/aws-cli/issues/6920
https://stackoverflow.com/questions/72126048/circleci-message-error-exec-plugin-invalid-apiversion-client-authentication
https://docs.aws.amazon.com/ja_jp/eks/latest/userguide/create-kubeconfig.html
https://elvisciotti.medium.com/how-to-fix-kubectl-exec-plugin-invalid-apiversion-client-authentication-k8s-io-v1alpha1-94fa583ef924
https://yaniv-bhemo.medium.com/fix-invalid-apiversion-client-authentication-k8s-io-v1alpha1-194b16b7ce90

参考になりました。ありがとうございます。

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?