There are several tools and services in the market that we can use to deploy and manage Kubernetes clusters. Some tools allow us to self-manage the cluster without charge, some require us to subscribe for the license, and some services are provided as a Kubernetes as a Service such as Amazon EKS and Red Hat OpenShift Dedicated. For development purposes or small-scale service, there is a free tool to manage Kubernetes clusters named minikube
which is available for Windows, Linux, and MacOS.
To build the cluster, Minikube supports several virtualization technologies such as Hypervisor, KVM, Docker, and so on. In this writing, we will try to utilize Docker as the virtualization solution and run it in Ubuntu 22.04. In general, we will run through the following steps.
- Install Minikube
- Install Docker
- Allow a non-root user to access Docker
- Start Minikube
- Enable Ingress extension
- Install Kubectl
Install Minikube
First, we need to install Minikube's dependencies and then download the binary to our machine.
sudo apt install -y curl wget apt-transport-https
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Then, we can store the executable file in the appropriate directory for binary files.
sudo cp minikube-linux-amd64 /usr/local/bin/minikube
sudo chmod +x /usr/local/bin/minikube
minikube version
Before we can start the Minikube, we need a virtualization tool in our machine, in this case, we utilize Docker.
Install Docker
We can follow the installation instructions available on the Docker website HERE.
Allow a non-root user to access Docker
This step is necessary because Minikube requires a non-root user to start the service while Docker needs otherwise. We can add an existing user to the docker
group.
sudo usermod -aG docker $USER
After running the above command, we need to leave the current user session and then re-enter the session to apply the change.
Start Minikube
Minikube will find the available driver automatically. Because we only have Docker in our machine, Minikube will use Docker by default.
minikube start
Enable Ingress extension
Ingress extension is useful to allow Minikube to direct requests into the Kubernetes cluster. Our machine will have an additional network driver with a specific IP that can be accessed by other services in our machine to go into the Kubernetes cluster.
minikube addons enable ingress
minikube ip
Install Kubectl
This tool is used to control and interact with the clusters. In Ubuntu, this tool is available in the package manager. For installing this tool, we can follow the instructions provided on the Kubernetes.io website HERE.
Comments
Post a Comment