Unable to connect to AWS EKS cluster

Viewed 3709

I am configuring an EKS cluster using terraform in a private subnet and trying to access it using a VPN in a public subnet. When I configured it, it works fine but now when I run kubectl get pods or kubectl get svc, it is throwing an error:

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

I don't know why it is happening. Please reply if you the solution.

Thanks

3 Answers

It's broken with kubectl version 1.24. Downgrade to 1.23.6 will fix the issue for now

sudo apt install kubectl=1.23.6-00

If you're experiencing this issue with GitHub actions and kodermax/kubectl-aws-eks, configure fixed versions for KUBECTL_VERSION and IAM_VERSION for each deployment step.

  - name: deploy to cluster
    uses: kodermax/kubectl-aws-eks@master
    env:
      KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA_STAGING }}
      ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
      ECR_REPOSITORY: my-app
      IMAGE_TAG: ${{ github.sha }
      KUBECTL_VERSION: "v1.23.6"
      IAM_VERSION: "0.5.3"

O/P of aws --version aws-cli/1.18.69 Python/3.6.9 Linux/5.4.0-1081-aws botocore/1.16.19

O/p of kubectl error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1" followed this steps for installing kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

i even tried downgraded the kubectl as sugested gavy but still facing the same issue

Related