Minikube Basics and How to Get Started with Kubernetes
This post and accompanying video guides you through the Minikube installation process. It explains and introduces a couple of essential Minikube commands you can use to work with your Kubernetes cluster, and shows you how to access your applications inside the cluster when using Minikube.
Managing Your Minikube Cluster
minikube start
. By default, the start command creates a virtual machine with 2 CPUs and 2000 MB of memory. Often, that might not be enough, so you can use --cpus
and --memory
flags to set the desired amount of CPUs and memory like this: minikube start --cpus=4 --memory 8192
.minikube stop
command. This will stop the virtual machine, but it leaves all the files around, so you can use the start command to start up the cluster again. I usually stop my cluster if I am not using it, so it's not eating up all the CPUs and memory.Troubleshooting Minikube Issues
minikube status
command to quickly get the status of your cluster. If you need to dig deeper and get more information on what's happening, use the minikube logs
command. The logs command will output all logs from the running Kubernetes instance.Interacting With Your Kubernetes Cluster
kubectl
) to interact with your cluster. However, if you're more visual, you can also use the Kubernetes dashboard. Minikube automatically installs Kubernetes dashboards and it has a convenience command called minikube dashboard
that creates a proxy to the dashboard and opens the dashboard UI in the browser.minikube ip
command. This command outputs the clusters IP to the standard out. You can use the combination of the IP address and your service ports to access the services.minikube service
. If your service is of a NodePort type, you can use this command to quickly access the service. Minikube will use the clusters IP and the port, and open your service in the browser.minikube tunnel
command. This command exposes all services with LoadBalancer type on the http://localhost
address.