kubectl command not found - Amazon Linux

Page content

How to Install kubectl Command on Amazon Linux

If you are working with Kubernetes clusters on Amazon Linux and find that the kubectl command is not available, you can follow these steps to install it.

Why is kubectl command not found?

Amazon Linux does not come with kubectl pre-installed because it is a specific tool used for interacting with Kubernetes clusters, and not all users may need it by default.

Installation Steps

To install kubectl on Amazon Linux, you can use the following commands:

sudo yum install -y kubectl

If the above command does not work, you can try installing kubectl using curl:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

Conclusion

After following the installation steps above, you should now have kubectl successfully installed on your Amazon Linux system. You can now use this command to interact with your Kubernetes clusters seamlessly.