Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Zheaoli/335bba0ad0e49a214c61cbaaa1b20306 to your computer and use it in GitHub Desktop.
Save Zheaoli/335bba0ad0e49a214c61cbaaa1b20306 to your computer and use it in GitHub Desktop.

Revisions

  1. Zheaoli revised this gist May 7, 2022. 2 changed files with 20 additions and 16 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,14 @@
    In v1.24.0, `kubectl` will report the following error when relying on the kubeconfig generated by aws-cli
    Please update your awscli to 2.6.3

    > error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
    ~~In v1.24.0, `kubectl` will report the following error when relying on the kubeconfig generated by aws-cli~~

    The reason is that Kubernetes deprecated `client.authentication.k8s.io/v1alpha1"` from the `exec` plugin in [PR108616](https://github.com/kubernetes/kubernetes/pull/108616)
    ~~> error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"~~

    And the aws-cli update [PR6476](https://github.com/aws/aws-cli/pull/6476/files) has not been merged. There are two solutions
    ~~The reason is that Kubernetes deprecated `client.authentication.k8s.io/v1alpha1"` from the `exec` plugin in [PR108616](https://github.com/kubernetes/kubernetes/pull/108616)~~

    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"
    ~~And the aws-cli update [PR6476](https://github.com/aws/aws-cli/pull/6476/files) 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"~~
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,14 @@
    在 v1.24.0 中,`kubectl` 在依赖 aws-cli 生成的 kubeconfig 的时候会报错如下
    升级 awscli 到 2.6.3

    > error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
    ~~在 v1.24.0 中,`kubectl` 在依赖 aws-cli 生成的 kubeconfig 的时候会报错如下~~

    原因是,Kubernetes 在 [PR108616](https://github.com/kubernetes/kubernetes/pull/108616) 中将 `client.authentication.k8s.io/v1alpha1"``exec` plugin 中废弃
    ~~> error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"~~

    而 aws-cli 的更新 [PR6476](https://github.com/aws/aws-cli/pull/6476/files) 还没有合并。解决方法有两个
    ~~原因是,Kubernetes 在 [PR108616](https://github.com/kubernetes/kubernetes/pull/108616) 中将 `client.authentication.k8s.io/v1alpha1"``exec` plugin 中废弃~~

    1. 将 kubectl 回退至任意小于 v1.24.0 的版本
    2. 以 MacOS + HomeBrew 为例:
    1. 修改你 kubeconfig 中的 "client.authentication.k8s.io/v1alpha1" 为 "client.authentication.k8s.io/v1beta1"
    2.`/usr/local/Cellar/awscli/{awscliVersion}/libexec/lib/python3.9/site-packages/awscli/customizations/eks/get_token.py` 中的 "client.authentication.k8s.io/v1alpha1" 修改为 "client.authentication.k8s.io/v1beta1"
    ~~而 aws-cli 的更新 [PR6476](https://github.com/aws/aws-cli/pull/6476/files) 还没有合并。解决方法有两个~~

    ~~1. 将 kubectl 回退至任意小于 v1.24.0 的版本~~
    ~~2. 以 MacOS + HomeBrew 为例:~~
    ~~1. 修改你 kubeconfig 中的 "client.authentication.k8s.io/v1alpha1" 为 "client.authentication.k8s.io/v1beta1"~~
    ~~2. 将 `/usr/local/Cellar/awscli/{awscliVersion}/libexec/lib/python3.9/site-packages/awscli/customizations/eks/get_token.py` 中的 "client.authentication.k8s.io/v1alpha1" 修改为 "client.authentication.k8s.io/v1beta1"~~
  2. Zheaoli revised this gist May 5, 2022. No changes.
  3. Zheaoli renamed this gist May 5, 2022. 1 changed file with 0 additions and 0 deletions.
  4. Zheaoli created this gist May 5, 2022.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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](https://github.com/kubernetes/kubernetes/pull/108616)

    And the aws-cli update [PR6476](https://github.com/aws/aws-cli/pull/6476/files) 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"
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    在 v1.24.0 中,`kubectl` 在依赖 aws-cli 生成的 kubeconfig 的时候会报错如下

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

    原因是,Kubernetes 在 [PR108616](https://github.com/kubernetes/kubernetes/pull/108616) 中将 `client.authentication.k8s.io/v1alpha1"` 从 `exec` plugin 中废弃

    而 aws-cli 的更新 [PR6476](https://github.com/aws/aws-cli/pull/6476/files) 还没有合并。解决方法有两个

    1. 将 kubectl 回退至任意小于 v1.24.0 的版本
    2. 以 MacOS + HomeBrew 为例:
    1. 修改你 kubeconfig 中的 "client.authentication.k8s.io/v1alpha1" 为 "client.authentication.k8s.io/v1beta1"
    2. 将 `/usr/local/Cellar/awscli/{awscliVersion}/libexec/lib/python3.9/site-packages/awscli/customizations/eks/get_token.py` 中的 "client.authentication.k8s.io/v1alpha1" 修改为 "client.authentication.k8s.io/v1beta1"