Configuring Kubernetes on bare-metal boxes is the stuff of Legends in the industry.
Thankfully, you will not normally do this. You will mostly work with managed kubernetes clusters provided by a service provider like AWS or GCP. Unfortunately, spinning up a managed kube cluster will cost money. To avoid this Kubernetes.io has created Minikube which is a kube cluster that runs on your laptop on a Virtual Machine.
Limitations of Minikube
- It does not support more than 1 node so its not possible to test things like distribution across nodes.
- It is not designed for production deployments.
Setting up
The instructions at
https://kubernetes.io/docs/tasks/tools/install-minikube/
are pretty self explanatory.
Running Minikube
minikube start --vm-driver=virtualbox
You can replace virtualbox with the VM you are using. On my 18.04 ubuntu virtualbox was super easy to install.
On linux you can also do the below if you dont want to install a VM.
minikube start --vm-driver=none
You should see something like this.
Testing your Minikube setup
To test minikube setup you will need to install kubectl. To do this you can follow the instructions here
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Running the command kubectl config get-contexts
should give you this output.
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minikube minikube minikube
kubectl get nodes
NAME STATUS ROLES AGE VERSION
m01 Ready master 15h v1.17.3
This means your Minikube is ready and working.