To use Kubernetes without installing it, follow the interactive tutorial on the Kubernetes website. But if you have Kubernetes cluster working in Cloud or on your local machine with Minikube. In order to get Kubernetes working, you need to install kubectl
.
kubectl
this is the command-line interface that lets you interact with Kuberentes. Using kubectl, you can inspect cluster resources; create, delete, and update components; look at your new cluster; and bring up example apps.
You must use a kubectl version that is within one minor version difference of your cluster.
Also note that the latest versions of Minikube packageskubectl
and will install it in your$PATH
if it is not found.
Installation
You can follow the instructions for your specific operating system or package manager in the Kubernetes documentation to install.
On Ubuntu, Debian
$ sudo apt-get update && sudo apt-get install -y apt-transport-https
$ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
$ echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update
$ sudo apt-get install -y kubectl
On CentOS, Fedora or RHEL
$ cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
$ yum install -y kubectl
On macOs
Users of macOS can get kubectl
simply via Homebrew:
$ brew install kubernetes-cli
On Windows
$ choco install kubernetes-cli