<p>i am trying to make a cicd pipeline github-&gt;travisci-&gt;aws eks
everything works fine images are posted to dockerhub and all.but when travis is executing kubectl apply -f &quot;the files&quot; it is throwing a error.. error: exec plugin: invalid apiVersion &quot;client.authentication.k8s.io/v1alpha1&quot;</p>
<p>(theres nothing wrong with the source coe/deployment/service files as i manually deployed them on aws eks and they worked fine.)</p>
<pre><code>
#-----------------travis.yml-------------
sudo: required
services:
  - docker
env:
  global:
    - SHA=$(git rev-parse HEAD)
before_install:
# Install kubectl
  - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
  - chmod +x ./kubectl
  - sudo mv ./kubectl /usr/local/bin/kubectl

 # Install AWS CLI
  - if ! [ -x &quot;$(command -v aws)&quot; ]; then curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot; ; unzip awscliv2.zip ; sudo ./aws/install ; fi
  # export environment variables for AWS CLI (using Travis environment variables)
  - export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
  - export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
  - export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
  # Setup kubectl config to use the desired AWS EKS cluster
  - aws eks update-kubeconfig --region ${AWS_DEFAULT_REGION} --name ${AWS_EKS_CLUSTER_NAME}
  
  - echo &quot;$DOCKER_PASSWORD&quot; | docker login -u &quot;$DOCKER_USERNAME&quot; --password-stdin
  - docker build -t akifboi/multi-client -f ./client/Dockerfile.dev ./client
 # - aws s3 ls

script:
  - docker run -e CI=true akifboi/multi-client npm test

deploy:
  provider: script
  script: bash ./deploy.sh
  on:
    branch: master
</code></pre>
<pre><code>#----deploy.sh--------
# docker build -t akifboi/multi-client:latest -t akifboi/multi-client:$SHA -f ./client/Dockerfile ./client
# docker build -t akifboi/multi-server:latest -t akifboi/multi-server:$SHA -f ./server/Dockerfile ./server
# docker build -t akifboi/multi-worker:latest -t akifboi/multi-worker:$SHA -f ./worker/Dockerfile ./worker

# docker push akifboi/multi-client:latest
# docker push akifboi/multi-server:latest
# docker push akifboi/multi-worker:latest

# docker push akifboi/multi-client:$SHA
# docker push akifboi/multi-server:$SHA
# docker push akifboi/multi-worker:$SHA

echo &quot;starting&quot;
aws eks --region ap-south-1 describe-cluster --name test001 --query cluster.status #eikhane ashe problem hoitese!
echo &quot;applying k8 files&quot;
kubectl apply -f ./k8s/
# kubectl set image deployments/server-deployment server=akifboi/multi-server:$SHA
# kubectl set image deployments/client-deployment client=akifboi/multi-client:$SHA
# kubectl set image deployments/worker-deployment worker=akifboi/multi-worker:$SHA

echo &quot;done&quot;
</code></pre>
<pre><code>#------travis;logs----------
last few lines:

starting

&quot;ACTIVE&quot;

applying k8 files

error: exec plugin: invalid apiVersion &quot;client.authentication.k8s.io/v1alpha1&quot;

done

Already up to date.

HEAD detached at c1858f7

Untracked files:

  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)

    aws/

    awscliv2.zip

nothing added to commit but untracked files present (use &quot;git add&quot; to track)

Dropped refs/stash@{0} (3b51f951e824689d6c35fc40dadf6fb8881ae225)

Done. Your build exited with 0.
</code></pre>

kif
<p>We were installing the latest version of kubectl in CI and hit this error today. After pinning to a previous version (1.18) the error was resolved.</p>
<p>the last working version was 1.23.6 and we saw errors with 1.24</p>
