How To Install Kubectl?
Install kubectl
-
Debian
apt-get install kubernetes-clientClick to copy -
CentOS
yum install kubernetes-clientClick to copy -
Fedora
dnf install kubernetes-clientClick to copy -
macOS
brew install kubernetes-cliClick to copy
Command line interface for running commands against Kubernetes clusters.
How to use kubectl?
Below are few example commands for kubectl that you can use in the terminal.
List all pods in all namespaces:kubectl get pods --all-namespacesClick to copyList all pods with more information (such as node name):kubectl get pods -o wideClick to copyUpdate specified pod with the label 'unhealthy' and the value 'true':kubectl label pods name unhealthy=trueClick to copyList all resources with different types:kubectl get allClick to copyShow metrics for all nodes:kubectl top nodeClick to copyShow metrics for all pods in the default namespace:kubectl top podClick to copyPrint the address of the master and cluster services:kubectl cluster-infoClick to copy
Install the latest version of kubectl in Debian, CentOS, Fedora and macOS from terminal. To install the kubectl just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of kubectl from the respository and install it in your computer/server.




