FG
☁️ Cloud & DevOpsAmazon

aws eks update-kubeconfig invalid apiVersion

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score95%
95%

Problem

Describe the bug Update kubectl from v1.23.6 to 1.24.0 and run commands [code block] I get the following error and exit status 1 [code block] Kubectl must need an updated apiVersion in kubeconfig file. Not sure if this is on aws side or kubectl side. https://github.com/kubernetes/kubectl/issues/1210 Expected Behavior No error message when using `kubectl` and `aws eks update-kubeconfig` Current Behavior error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1" Reproduction Steps Update kubectl from v1.23.6 to 1.24.0 and run commands [code block] Possible Solution _No response_ Additional Information/Context _No response_ CLI version used whatever is running in aws/codebuild/standard:5.0 Environment details (OS name and version, etc.) aws/codebuild/standard:5.0

Error Output

error and exit status 1

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Update kubeconfig apiVersion for kubectl compatibility

Medium Risk

The error occurs because the kubeconfig file generated by AWS EKS is using an outdated apiVersion for the exec plugin. Specifically, it is set to 'client.authentication.k8s.io/v1alpha1', which is not supported in kubectl v1.24.0. The newer versions of kubectl require the apiVersion to be updated to 'client.authentication.k8s.io/v1beta1'.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Backup existing kubeconfig

    Before making any changes, back up your existing kubeconfig file to prevent data loss.

    bash
    cp ~/.kube/config ~/.kube/config.bak
  2. 2

    Update kubeconfig using aws eks update-kubeconfig

    Run the command to update your kubeconfig file with the latest configuration from AWS EKS.

    bash
    aws eks update-kubeconfig --name <your-cluster-name>
  3. 3

    Manually edit kubeconfig file

    Open the kubeconfig file located at ~/.kube/config and locate the exec section. Change the apiVersion from 'client.authentication.k8s.io/v1alpha1' to 'client.authentication.k8s.io/v1beta1'.

    bash
    nano ~/.kube/config
  4. 4

    Verify the changes

    After editing the kubeconfig file, verify that the apiVersion has been updated correctly and that there are no syntax errors.

    bash
    kubectl config view
  5. 5

    Test kubectl commands

    Run a simple kubectl command to ensure that the configuration is working correctly and that the error no longer appears.

    bash
    kubectl get nodes

Validation

Confirm that running 'kubectl get nodes' returns the expected output without any errors. Additionally, check that the apiVersion in the kubeconfig file is now set to 'client.authentication.k8s.io/v1beta1'.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

awsclicloudbugeks-kubeconfigeks