Cloud / DevOps / Kubernetes
In this guide, we’ll explore how to set up and test the latest Kubernetes 1.31 using minikube. We’ll create a 3-node cluster with specific configurations to provide a robust local development environment.
Kubernetes 1.31 introduces several new features and improvements:
For a detailed overview, check out the Kubernetes 1.31 release notes.
First, ensure that you have the latest version of Minikube. Update it if necessary:
$ minikube update-check
Then, start your minikube cluster with the following command:
$ minikube start \
--driver=virtualbox \
--nodes 3 \
--cni calico \
--cpus=2 \
--memory=2g \
--kubernetes-version=v1.31.0 \
--container-runtime=containerd \
--profile k8s-1-31
Here’s a breakdown of the command:
--driver=virtualbox
: Specifies VirtualBox as the driver.--nodes 3
: Creates a 3-node cluster.--cni calico
: Uses Calico for the Container Network Interface.--cpus=2
: Allocates 2 CPUs to each node.--memory=2g
: Allocates 2GB of RAM to each node.--kubernetes-version=v1.31.0
: Specifies Kubernetes version 1.31.0.--container-runtime=containerd
: Uses containerd
as the container runtime.--profile=k8s-1-31
: Give each cluster a unique name (to avoid disturbing other minikube clusters if you have any)You will see the logs from minikube, where you can see the Kubernetes cluster nodes are created one by one.
😄 [k8s-1-31] minikube v1.33.1 on Fedora 40
❗ Specified Kubernetes version 1.31.0 is newer than the newest supported version: v1.30.0. Use `minikube config defaults kubernetes-version` for details.
❗ Specified Kubernetes version 1.31.0 not found in Kubernetes version list
🤔 Searching the internet for Kubernetes version...
✅ Kubernetes version 1.31.0 found in GitHub version list
✨ Using the virtualbox driver based on user configuration
👍 Starting "k8s-1-31" primary control-plane node in "k8s-1-31" cluster
🔥 Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
📦 Preparing Kubernetes v1.31.0 on containerd 1.7.15 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring Calico (Container Networking Interface) ...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
🔎 Verifying Kubernetes components...
👍 Starting "k8s-1-31-m02" worker node in "k8s-1-31" cluster
...<removed for brevity>...
👍 Starting "k8s-1-31-m03" worker node in "k8s-1-31" cluster
...<removed for brevity>...
🏄 Done! kubectl is now configured to use "k8s-1-31" cluster and "default" namespace by default
After starting minikube, verify the status of your cluster:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-1-31 Ready control-plane 2m27s v1.31.0
k8s-1-31-m02 Ready <none> 86s v1.31.0
k8s-1-31-m03 NotReady <none> 28s v1.31.0
You should see three nodes listed, each in the Ready
state. This confirms that your 3-node cluster is up and running with Kubernetes 1.31.
Once you finish testing, you stop or delete the minikube cluster by mentioning the correct minikube profile as follows.
$ minikube stop --profile k8s-1-31
✋ Stopping node "k8s-1-31-m03" …
✋ Stopping node "k8s-1-31-m02" …
✋ Stopping node "k8s-1-31" …
🛑 3 nodes stopped.
Congratulations! You’ve successfully set up and tested Kubernetes 1.31 with minikube and VirtuBox on a 3-node cluster.
If you prefer Podman or Docker as the driver for minikube, then it is simple as follows.
$ minikube start \
--driver=podman \
--nodes 3 \
--cni calico \
--cpus=2 \
--memory=2g \
--kubernetes-version=v1.31.0 \
--container-runtime=containerd \
--profile k8s-1-31-podman
Please note, I have used –driver=podman and a new minikube profile (--profile k8s-1-31-podman
) for my new cluster.
If I check my nodes now, I can see the nodes are running as follows.
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-1-31-podman Ready control-plane 2m34s v1.31.0
k8s-1-31-podman-m02 Ready <none> 2m16s v1.31.0
k8s-1-31-podman-m03 Ready <none> 2m3s v1.31.0
Since you used different profiles for different clusters, you can always switch back to the other minikube cluster anytime.
Let us list the cluster profiles.
$ minikube profile list
|-----------------|------------|------------|----------------|------|---------|---------|-------|----------------|--------------------|
| Profile | VM Driver | Runtime | IP | Port | Version | Status | Nodes | Active Profile | Active Kubecontext |
|-----------------|------------|------------|----------------|------|---------|---------|-------|----------------|--------------------|
| cluster2-podman | podman | containerd | | 8443 | v1.30.0 | Unknown | 1 | | |
| k8s-1-31 | virtualbox | containerd | 192.168.59.176 | 8443 | v1.31.0 | Stopped | 3 | | |
| k8s-1-31-podman | podman | containerd | 10.88.0.4 | 8443 | v1.31.0 | Running | 3 | * | * |
|-----------------|------------|------------|----------------|------|---------|---------|-------|----------------|--------------------|
If I want to switch to my minikube + VirtualBox cluster based on Kubernetes 1.31, I can use the following command.
$ minikube profile k8s-1-31
✅ minikube profile was successfully set to k8s-1-31
Also, remember to start/stop/delete unused minikube profiles and clusters to save your computing resources.
$ minikube stop --profile=k8s-1-31-podman
# Switch to other minikube profile
$ minikube profile k8s-1-31
✅ minikube profile was successfully set to k8s-1-31
# Start the cluster if its stopped; ignore otherwise.
$ minikube start --profile k8s-1-31
# Check cluster nodes
$ $ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-1-31 Ready control-plane 17m v1.31.0
k8s-1-31-m02 Ready <none> 64s v1.31.0
k8s-1-31-m03 Ready <none> 22s v1.31.0
These environments are perfect for experimenting with the latest features and enhancements in Kubernetes 1.31.
Disclaimer:
The views expressed and the content shared in all published articles on this website are solely those of the respective authors, and they do not necessarily reflect the views of the author’s employer or the techbeatly platform. We strive to ensure the accuracy and validity of the content published on our website. However, we cannot guarantee the absolute correctness or completeness of the information provided. It is the responsibility of the readers and users of this website to verify the accuracy and appropriateness of any information or opinions expressed within the articles. If you come across any content that you believe to be incorrect or invalid, please contact us immediately so that we can address the issue promptly.
Gineesh Madapparambath
Gineesh Madapparambath is the founder of techbeatly and he is the co-author of The Kubernetes Bible, Second Edition. and the author of 𝗔𝗻𝘀𝗶𝗯𝗹𝗲 𝗳𝗼𝗿 𝗥𝗲𝗮𝗹-𝗟𝗶𝗳𝗲 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻.
He has worked as a Systems Engineer, Automation Specialist, and content author. His primary focus is on Ansible Automation, Containerisation (OpenShift & Kubernetes), and Infrastructure as Code (Terraform).
(aka Gini Gangadharan - iamgini.com)
This site uses Akismet to reduce spam. Learn how your comment data is processed.1 Response
Leave a Reply Cancel reply
[…] can use any existing or new cluster or even spin up a minikube cluster on your laptop/workstation for testing […]