At the time of writing this tutorial, Kubernetes is the industry standard for the container-orchestration system. Kubernetes can be used with many container image formats. Here in this tutorial, we assume the containers’ images are created using Docker. there are many options available to create a kubernetes cluster. In this tutorial, we use Minikube which is a tool for running a one-node kubernetes cluster on your local machine for learning and development purposes.
installing minikube (Linux and macOS)
Download the latest minikube binary:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
Make minikube binary executable:
chmod +x minikube
Move it to
/usr/local/bin/ so that it can be excited from any directory:
sudo mv minikube /usr/local/bin/
minikube start for the first time, minikube downloads the Minikube ISO and attempts to create a VM in your machine:
If you have VirtualBox installed on your machine it creates a VM using VirtualBox driver and starts it. Minikube internally uses kubeadm to bootstrap a kubernetes cluster inside newly created VM. You can verify it in the VirtualBox desktop application.
Minikube automatically creates two folders
~/.minikube in your home directory which holds the configurations for
kubectl and Minikube respectively.
kubectl is a command-line tool that is used to run commands against the kubernetes cluster. in our setup kubectl uses the
~/.kube/config file to connect to our cluster.
there are two other ways available to talk to the cluster. RESTful API server and GUI dashboard are the others. In this tutorial, we are going to install and use the kubectl command-line tool.
Installing kubectl (Linux and macOS)
Download the latest kubectl binary using
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
Make the binary executable:
chmod +x ./kubectl
Move it to PATH so that it can be easily accessed:
sudo mv ./kubectl /usr/local/bin/kubectl
To verify that kubectl can find and use the config file created by Minicube run: