/
KUBECTL Upgrade

KUBECTL Upgrade

 

Kubectl is a command line tool that you use to communicate with the Kubernetes API server. The kubectl binary is available in many operating system package managers. Using a package manager for your installation is often easier than a manual download and install process.

Note: You must use a kubectl version that is within one minor version difference of your Amazon EKS cluster control plane. For example, a 1.29 kubectl client works with Kubernetes 1.28, 1.29, and 1.30 clusters.

To install or update kubectl

1. Determine whether you already have kubectl installed on your device.

kubectl version --client

If you have kubectl installed in the path of your device, the example output includes information similar to the following. If you want to update the version that you currently have installed with a later version, complete the next step, making sure to install the new version in the same location that your current version is in.

Client Version: v1.30.X-eks-1234567

If you receive no output, then you either don't have kubectl installed, or it's not installed in a location that's in your device's path.

  1. Install or update kubectl on macOS, Linux, and Windows operating systems.

To install or update kubectl on Linux

  1. Download the kubectl binary for your cluster's Kubernetes version from Amazon S3.

    • Kubernetes 1.30

      curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.30.0/2024-05-12/bin/linux/amd64/kubectl
    • Kubernetes 1.30

      curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.30.0/2024-05-12/bin/linux/amd64/kubectl
    • Kubernetes 1.29

      curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.29.3/2024-04-19/bin/linux/amd64/kubectl
    • Kubernetes 1.28

    • Kubernetes 1.27

    • Kubernetes 1.26

    • Kubernetes 1.25

    • Kubernetes 1.24

    • Kubernetes 1.23

    • Kubernetes 1.22

    • Kubernetes 1.21

  2. (Optional) Verify the downloaded binary with the SHA-256 checksum for your binary.

    1. Download the SHA-256 checksum for your cluster's Kubernetes version from Amazon S3 using the command for your device's hardware platform. The first link for each version is for amd64 and the second link is for arm64.

      • Kubernetes 1.30

      • Kubernetes 1.30

      • Kubernetes 1.29

      • Kubernetes 1.28

      • Kubernetes 1.27

      • Kubernetes 1.26

      • Kubernetes 1.25

      • Kubernetes 1.24

      • Kubernetes 1.23

      • Kubernetes 1.22

      • Kubernetes 1.21

    2. Check the SHA-256 checksum for your downloaded binary with one of the following commands.

      • When using this command, make sure that you see the following output:

      • When using this command, make sure that the generated checksum in the output matches in the checksum in the downloaded kubectl.sha256 file.

  3. Apply execute permissions to the binary.

  4. Copy the binary to a folder in your PATH. If you have already installed a version of kubectl, then we recommend creating a $HOME/bin/kubectl and ensuring that $HOME/bin comes first in your $PATH.

  5. (Optional) Add the $HOME/bin path to your shell initialization file so that it is configured when you open a shell.

    Note

    This step assumes you are using the Bash shell; if you are using another shell, change the command to use your specific shell initialization file.

  6. After you install kubectl, you can verify its version.

When first installing kubectl, it isn't yet configured to communicate with any server. We will cover this configuration as needed in other procedures. If you ever need to update the configuration to communicate with a particular cluster, you can run the following command. Replace region-code with the AWS Region that your cluster is in. Replace my-cluster with the name of your cluster.

To install or update kubectl on Windows

  1. Open a PowerShell terminal.

  2. Download the kubectl binary for your cluster's Kubernetes version from Amazon S3.

    • Kubernetes 1.30

    • Kubernetes 1.29

    • Kubernetes 1.28

    • Kubernetes 1.27

    • Kubernetes 1.26

    • Kubernetes 1.25

    • Kubernetes 1.24

    • Kubernetes 1.23

    • Kubernetes 1.22

    • Kubernetes 1.21

  3. (Optional) Verify the downloaded binary with the SHA-256 checksum for your binary.

    1. Download the SHA-256 checksum for your cluster's Kubernetes version for Windows.

      • Kubernetes 1.30

      • Kubernetes 1.29

      • Kubernetes 1.28

      • Kubernetes 1.27

      • Kubernetes 1.26

      • Kubernetes 1.25

      • Kubernetes 1.24

      • Kubernetes 1.23

      • Kubernetes 1.22

      • Kubernetes 1.21

    2. Check the SHA-256 checksum for your downloaded binary.

    3. Make sure that the generated checksum in the output matches in the checksum in the downloaded kubectl.sha256 file. The PowerShell output should be an uppercase equivalent string of characters.

  4. Copy the binary to a folder in your PATH. If you have an existing directory in your PATH that you use for command line utilities, copy the binary to that directory. Otherwise, complete the following steps.

    1. Create a new directory for your command line binaries, such as C:\bin.

    2. Copy the kubectl.exe binary to your new directory.

    3. Edit your user or system PATH environment variable to add the new directory to your PATH.

    4. Close your PowerShell terminal and open a new one to pick up the new PATH variable.

  5. After you install kubectl, you can verify its version.

When first installing kubectl, it isn't yet configured to communicate with any server. We will cover this configuration as needed in other procedures. If you ever need to update the configuration to communicate with a particular cluster, you can run the following command. Replace region-code with the AWS Region that your cluster is in. Replace my-cluster with the name of your cluster.

Related content

Kubernetes Configuration Upgrade
Kubernetes Configuration Upgrade
More like this
Kubernetes Framework - AKS Cluster Upgrade Guide
Kubernetes Framework - AKS Cluster Upgrade Guide
More like this
AC Cloud customer AKS cluster version upgrade
AC Cloud customer AKS cluster version upgrade
More like this
Install using Rancher
Install using Rancher
More like this
Solution Promotion prerequisites
Solution Promotion prerequisites
More like this
Deploying KEDA
More like this