📜  kubectl install - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:32:31.779000             🧑  作者: Mango

kubectl install - Shell-Bash

kubectl is a command-line tool used to manage Kubernetes clusters. In this article, we will cover the steps to install kubectl on a system using the Shell-Bash script.

Prerequisites

Before you begin, ensure that you have the following prerequisites:

  • A running Kubernetes cluster
  • A system running either Linux or macOS
Steps

Follow the below steps to install kubectl using Shell-Bash:

  1. Open a terminal window on your system.
  2. Download the kubectl binary using the curl command:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

This command will download the latest version of kubectl for Linux.

  1. Make the kubectl binary executable using the chmod command:
chmod +x ./kubectl
  1. Move the kubectl binary to a directory in your system PATH, so it can be easily executed:
sudo mv ./kubectl /usr/local/bin/kubectl
  1. Confirm the installation was successful by running the kubectl version command:
kubectl version

This command will show you the version of kubectl that was installed on your system.

Conclusion

In this article, we covered the steps to install kubectl on a system using Shell-Bash. Now you can manage your Kubernetes clusters using kubectl on your system.