- Aiden’s Lab Notebook
- Posts
- ðŸ”Your Easiest Path to Kubernetes Practice: Setting Up a Minikube Cluster
ðŸ”Your Easiest Path to Kubernetes Practice: Setting Up a Minikube Cluster
We'll explore why Minikube is a fantastic choice for getting hands-on with Kubernetes and walk through the steps to build your very own local cluster.
Hello, and welcome to your Aiden's Lab Notebook.
Kubernetes has pretty much become the standard in cloud environments. Many companies and teams are either building their own Kubernetes clusters on servers or using managed Kubernetes services.
So, while many of us are curious about Kubernetes and cloud-native tools, let's be honest, the barrier to entry can still feel pretty high.
One of the main reasons is that setting up a Kubernetes environment usually means installing it on a separate server or paying for a managed service.
For those who just want to dip their toes into Kubernetes or run some light tests locally, this can be quite a hurdle.
To tackle this, various tools have emerged. The one I want to share with you today is minikube.

Why Minikube Shines for Kubernetes Practice and Testing
Minikube is a tool that helps you quickly and easily install a single-node or multi-node Kubernetes cluster on your local machine.
There are other tools out there that do similar things. So, why do I recommend minikube for Kubernetes practice and testing?
1. You can set up and manage an environment that closely mirrors a real Kubernetes setup with just a few commands, without getting bogged down in complex configurations.
This means you can dive straight into practicing or testing Kubernetes-related tasks, which is super convenient.
2. While managed Kubernetes services from cloud providers like AWS or GCP can incur costs even for learning purposes, minikube runs locally, so it's completely free.
This allows you to experiment with various Kubernetes features or cloud-native tools like Helm to your heart's content, without worrying about the bill.
3. Because minikube runs inside a virtual machine (VM) or a container, it provides an isolated environment, separate from the rest of your local system.
So, any errors or configuration changes you make during practice won't directly impact your local PC's operating system.
4. Minikube uses the standard Kubernetes API and interacts with the cluster using actual Kubernetes tools like kubectl.
It supports not only single-node clusters but also multi-node setups, meaning you get to experience core concepts and behaviors almost exactly as you would in a production environment.
This makes the learning curve from minikube to real-world work environments much smoother.
5. Minikube supports all major operating systems, including Windows, macOS, and Linux.
So, regardless of your local PC's operating system, you can start learning and testing Kubernetes with minikube.
With all these benefits, you might be eager to jump right in and start using minikube.
But before we get to the installation, now that we've covered the pros, let's also look at a few things to keep in mind.
Things to Keep in Mind Before Installing Minikube
Minikube Minimum System Requirements
Since minikube sets up a new Kubernetes cluster within a VM or container environment, it does require a certain amount of system resources.
Based on the official documentation, it’s generally recommended to have at least 2 CPU cores, 2GB+ of RAM, and 20GB+ of free disk space.
Check if You Have a Supported Virtualization Tool Installed
Minikube comes with drivers for various virtualization tools to enable it to run in VM or container environments across different operating systems.
The available virtualization tools for minikube can vary depending on your OS. Here’s a summary of the typical supported tools for each:
Windows: Hyper-V (VM), Docker Desktop (VM + Container)
macOS: HyperKit (VM), Docker Desktop (VM + Container)
Linux: KVM (VM), Docker (Container)
This means if you have one of these virtualization tools installed on your respective OS, minikube can use that technology to create a Kubernetes cluster.
When minikube starts, it automatically detects available virtualization tools on your OS, so no separate configuration is usually needed. However, if you have multiple virtualization tools installed on your local PC, you can specify which one minikube should use if you prefer.
Consider if Additional Network Configuration is Needed
Ultimately, Kubernetes is an environment for deploying services, so network configuration is also important.
In some corporate network environments or specific network setups, firewalls or VPNs might block communication within the minikube cluster or access to the external internet.
In such cases, you might need to perform additional tasks like opening necessary ports or adjusting VPN settings.
However, if you find yourself needing to adjust network settings for minikube within a team or organization, it's crucial to first check your organization's relevant policies.
Be Aware of Potential Conflicts with Existing Tools
If you're using Windows or macOS, you might already have Docker Desktop installed.
Docker Desktop offers its own feature to run a Kubernetes cluster.
If you try to use minikube while this feature is enabled, you might run into issues with conflicting kubectl contexts or ports.
Therefore, it's best to choose one or the other, or ensure you're properly and clearly switching kubectl contexts.
The kubectl CLI reliably interacts with Kubernetes clusters that are within one minor version (plus or minus) of its own.
For example, if your kubectl version is 1.33, it will work reliably with Kubernetes versions 1.32, 1.33, and 1.34.
So, if there's a significant version mismatch between your locally installed kubectl and the Kubernetes cluster version created by minikube, some commands might not work as expected or could throw errors.
If possible, try to align the versions. If that's tricky, you can always use Minikube's built-in kubectl by prefixing your commands with minikube kubectl --
.
Now that we've covered what to consider before installing minikube, it's time to actually install it and create a cluster, right? I’ve put together a step-by-step guide for you to follow along. Let's dive in!
Minikube Installation and Cluster Creation Guide
1. Installing minikube
The official minikube website already provides scripts and guides to easily install minikube for each operating system. Please check the official minikube documentation for installation commands specific to your OS.
Since I'm on a WSL environment, I was able to easily install minikube by running the following commands for Linux (from the official docs) in my terminal:

curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
To verify that minikube installed correctly, run the minikube version
command in your terminal. You should see the currently installed version of minikube, like below:

And that's really all there is to installing minikube. Pretty straightforward, right?
Now, let's create a Kubernetes cluster with minikube.
2. Creating a Kubernetes Cluster with minikube
You can create a basic cluster with just the minikube start
command. However, minikube has a concept called "Profiles," which allows you to name and manage each Kubernetes cluster created by minikube separately.
Using the command minikube start -p {profile_name}
, you can create a k8s cluster with your desired name.
Let's use this Profile option to make it easier for our various Kubernetes practices and tests.
Run the following command to create a Kubernetes cluster named k8s-test
:
minikube start -p k8s-test
You'll then see the process of minikube creating the Kubernetes cluster named k8s-test in your terminal, like this:

Once the minikube start
command completes, we should check if the Kubernetes cluster was actually created, right?
The minikube status
command gives you a brief overview of the cluster's status, including the host, kubelet, and Kubernetes API server.
This allows you to quickly see if the cluster is running normally and if there are any issues with the main Kubernetes components.
Since we specified a Profile when creating our cluster, we'll run the command like this:
minikube status -p k8s-test
You'll then see the status information for the k8s-test
cluster, as shown below. Everything looks good and is running normally!

3. Checking kubectl Integration
To manage a Kubernetes cluster, you need the kubectl CLI. I already had kubectl installed on my local PC.
Even though I haven't touched any kubectl settings yet, let's try running kubectl get pod
, a command to list Pods.

It shows a message saying "No resources found in default namespace." This means kubectl is correctly connected to the cluster! But... why does this work?
Did minikube somehow change my existing kubectl configuration when it created the k8s-test
cluster?
You guessed it! When the minikube start
command finishes, it automatically updates the kubectl context to point to the cluster minikube just created.
So, if you run kubectl config current-context
after minikube start
is finished, you'll see that kubectl is indeed pointing to the k8s-test
cluster:

4. Exploring the Minikube Dashboard
The last feature we'll look at is the minikube dashboard.
This command launches a web-based dashboard that allows you to visually monitor and manage your Kubernetes cluster.
Through this dashboard, you can conveniently view information about Kubernetes resources like Pods, Deployments, and Services in a GUI environment, and even perform simple management tasks.
Let's launch the dashboard for our k8s-test
cluster with the following command:
minikube dashboard -p k8s-test
You'll see a message indicating that the dashboard is running:

Click on the URL at the bottom of the terminal message, and you'll be able to see the cluster dashboard in your web browser, like this:

Right now, there are no resources in the cluster, but as you practice and deploy various resources, you'll be able to see them all at a glance in the dashboard.
5. Stopping Your Minikube Cluster
If you're done with your practice or testing on the minikube cluster, you can stop it using the minikube stop
command.
This command stops the virtual machine or container used to create the cluster, but it preserves the data.
So, if you don't need the cluster running right away but plan to resume work later, you can use minikube stop
to free up resources on your local PC.
Let's stop our k8s-tes
t cluster with the following command:
minikube stop -p k8s-test
You'll then see a message indicating that the nodes composing the cluster have been stopped:

Wrapping Up
So far, we've looked at why minikube is advantageous for Kubernetes practice and testing, things to consider before installation, and the basic steps for installing and using minikube.
I hope this guide has been helpful, even for those who knew about minikube but hadn't gotten around to installing or using it yet.
Now that we've installed minikube and gone through creating and managing a cluster, the next step is to actually use this cluster for Kubernetes exercises or to try out cloud-native tools, wouldn't you agree?
So, in the next post, we'll dive into some hands-on practice using Kubernetes and cloud-native tools on our minikube setup.
Stay tuned for the next one!
References
✨Enjoyed this issue?
How about this newsletter? I’d love to hear your thought about this issue in the below form!
👉 Feedback Form
Your input will be help improve Aiden’s Lab Notebook and make it more useful for you.
Thanks again for reading this notebook from Aiden’s Lab :)