Closed luciferhs closed 1 year ago
that error happens when the code is unable to create a clientset config in memory, three questions spring to mind
so I just faced the same issue by updating kubectl. It seems it is related:
✗ kubectl version
Client Version: version.Info{Major:"1", Minor:"22+", GitVersion:"v1.22.6-eks-7d68063", GitCommit:"f24e667e49fb137336f7b064dba897beed639bad", GitTreeState:"clean", BuildDate:"2022-02-23T19:32:14Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22+", GitVersion:"v1.22.9-eks-a64ea69", GitCommit:"540410f9a2e24b7a2a870ebfacb3212744b5f878", GitTreeState:"clean", BuildDate:"2022-05-12T19:15:31Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
➜ k ice cpu --match 'used>0' --sort '!USED'
failed to create clientset: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
at the same time kubectl works as expected:
➜ kubectl get pods
No resources found in default namespace.
to fix you need to update to latest aws cli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install --update
➜ k ice cpu --match 'used>0' --sort '!USED'
no pods found in default namespace
and don't forget to do after you update aws cli
✗ aws eks --region us-east-1 update-kubeconfig --name project-staging-eks
Updated context arn:aws:eks:us-east-1:xxxx:cluster/project-staging-eks in /home/dmitry/.kube/config
moved answer to faq page also linked it back here
https://nimblearchitect.github.io/kubectl-ice/faq/#failed-to-create-clientset
[root@mexo-relay ~]# kubectl-ice cpu -A failed to create clientset: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"