Deploying a Kubernetes Cluster Using Minikube
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Minikube is a tool that makes it easy to run Kubernetes locally. It runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day. Below are the steps and essential commands for deploying a Kubernetes cluster using Minikube.
A computer with at least 2GB of RAM and 2 CPUs.
Internet connection for downloading Minikube and Kubernetes binaries.
Ensure no other hypervisors are running (like VMware or VirtualBox).
Windows: Download the installer or use Chocolatey (choco install minikube
).
macOS: Use Homebrew (brew install minikube
) or download the binary.
Linux: Download the binary and install it manually.
Open a terminal or command prompt.
Run the command: minikube start
. This command starts a Minikube VM and Kubernetes cluster. By default, it uses the virtualization technology available on the platform (like Hyper-V, KVM, Docker, etc.).
Run minikube status
to check the status of the Minikube VM and the Kubernetes cluster running inside it.
Run minikube dashboard
to open the Kubernetes dashboard in a web browser.
Use kubectl
commands to deploy applications. For example, kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
.
To access the deployed applications, expose them as services. For example, kubectl expose deployment hello-minikube --type=NodePort --port=8080
.
Use minikube service hello-minikube
to access the exposed application.
When finished, you can stop the Minikube VM with minikube stop
.
If you want to delete the Minikube cluster and start over, use minikube delete
.
minikube start: Starts a Minikube Kubernetes cluster.
minikube status: Shows the status of the Minikube cluster.
minikube dashboard: Opens the Kubernetes dashboard.
minikube stop: Stops the running Minikube cluster.
minikube delete: Deletes the Minikube cluster.
minikube service [service-name]: Exposes a service to the host system.
minikube ip: Displays the IP address of the Minikube VM.
minikube addons list: Lists available addons.
minikube addons enable [addon-name]: Enables an addon.
minikube addons disable [addon-name]: Disables an addon.
Minikube provides an easy and convenient way to get a Kubernetes cluster up and running locally for development and testing purposes. It’s a great tool for anyone starting out with Kubernetes or those needing a quick way to prototype and test Kubernetes applications. Remember, Minikube is not meant for production use, but it's a valuable tool for learning and experimentation.