Introduction to Minikube
Minikube is a tool that allows you to run a single-node Kubernetes cluster on your local machine, ideal for developers and administrators who want to test applications without the need for cloud infrastructure. In Linux environments, its integration is fluid because it takes advantage of the kernel and the system's native containers. This post will guide you step by step from installation to deployment of your first application, using only the standard command line and packages of most distributions.
Previous requirements
Before you start, make sure you have a recent Linux distribution (Ubuntu 22.04, Fedora 38 or similar) with sudo access. You will need a compatible hyperviewer; Minikube supports Docker, VirtualBox and KVM2, and Docker is the easiest option if you already have it installed. It is also useful to havecurlandwgetto download binaries, and have enabled virtualization in the BIOS (VT-x / AMD-v). Check that your user belongs to the groupdockerto avoid using sudo every time you run containers.
Installation of units
First install Docker, which will be Minikube's default driver. At Ubuntu you can runsudo apt update && sudo apt install -y docker.ioand thensudo systemctl enable --now docker. In Fedora usessudo dnf install -y dockerandsudo systemctl enable --now docker. Add your user to the Docker group withsudo usermod -aG docker $USERand restart the session. Then installkubectl, the Kubernetes CLI:curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl", make it executable and move it to/usr/local/bin.
Download and install Minikube
Get Minikube's latest binary from your official page. Runcurl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64, thensudo install minikube-linux-amd64 /usr/local/bin/minikube. Verifies the installation withminikube version. If you prefer to use a package manager, in Ubuntu you can add the repositorydeb https://apt.kubernetes.io/ kubernetes-xenial mainand install withaptbut the binary method guarantees the most current version.
Start the cluster
With the units ready, it launches Minikube specifying Docker as driver:minikube start --driver=docker. The command will download a light Linux image with Kubernetes components (etcd, apiserver, controller manager, kubelet) and create a single node. This process can take several minutes the first time; watch the output to confirm that the cluster is in conditionRunning. You can check the nodes withkubectl get nodesand control panel withminikube dashboard.
Interacting with kubectl
Once the cluster is active,kubectlautomatically points to the Minikube context. Test runningkubectl get pods -Ato see the system's pods. Slide a test application, for example a nginx server:kubectl create deployment nginx --image=nginx. Then expand the port withkubectl expose deployment nginx --port=80 --type=NodePort. Get the access URL withminikube service nginx --urland open it in your browser to see the default page of nginx.
Example of full deployment
To consolidate knowledge, deploy a simple web application with a YAML file. Create a fileapp.yamlwith a Deployment with three replica of a container image serving a static HTML page and a LoadBalancer Service (in Minikube it behaves as NodePort). Apply the manifesto withkubectl apply -f app.yaml. Check that the pods are ready withkubectl get pods -wand that the service is accessible byminikube service app --url. This flow shows how to move from the command line to infrastructure statements as a code.
Good practice and cleaning
When you're done experimenting, stop the cluster to release resources:minikube stop. If you want to delete the whole state and start over, useminikube delete. Remember that the persistent volumes created withhostPaththey persist outside the cluster; remove them manually if you don't need them. Keep both Minikube and kubectl up to date following the same download procedure or subscribing to the launch channels of each project. Finally, check the log withminikube logsto purify boot problems.
Conclusion
Minikube transforms your Linux workstation into a complete test environment for Kubernetes, allowing you to validate configurations, test Helm Charts and familiarize yourself with API without infrastructure costs. Following the installation, configuration and deployment steps described above, you will have a solid basis for moving towards cloud production clusters or local data centres. The combination of the command line, YAML manifests and the control panel provides an integral learning experience that is essential for any DevOps professional or the development of containing applications.


