Learn how to install Minikube on Ubuntu 22.04. Our Kubernetes Support team is here to help you with your questions and concerns.
An Overview:
- The Key Features of Minikube
- Prerequisites to Install Minikube on Ubuntu
- How to Install Minikube on Ubuntu 22.04
- How to Manage Minikube Cluster
A Guide to Minikube on Ubuntu 22.04
Kubernetes is an open-source container orchestration platform designed to automate the deployment, scaling, and management of containerized applications.
However, setting up Kubernetes can be a difficult task for beginners. This is where Minikube comes in handy.
Minikube is an essential tool for running Kubernetes clusters locally. It provides an environment to test, develop, and explore Kubernetes functionalities without the overhead of managing a full-fledged cloud-based cluster.
Minikube is an open-source tool that lets us run a single-node Kubernetes cluster locally on our system. It is designed to make it easy for developers to set up a Kubernetes environment for local development and testing purposes, creating a lightweight, isolated Kubernetes cluster that runs inside a virtual machine on our local system.
The Key Features of Minikube
Minikube is a popular choice because of its following key features:
- Minikube is easy to install and use, with simple commands to start, stop, and manage the local Kubernetes cluster. This makes it accessible to both beginners and experienced users.
- Also, Minikube supports a range of Kubernetes add-ons, such as Ingress, DNS, and Dashboard. This extends the local cluster’s functionality and provides a more comprehensive development environment.
- Minikube is compatible with various operating systems, including Linux, macOS, and Windows. This wide support ensures that developers can employ Minikube on their preferred platform without worrying about conflicts.
- It is part of the Kubernetes project and is maintained by the Kubernetes community. This ensures that it stays up-to-date with the latest Kubernetes releases and features.
Prerequisites to Install Minikube on Ubuntu
Before we begin the installation process, make sure the system meets the following requirements:
- Ubuntu 22.04 system
- 2 GB RAM or more
- 2 CPU cores or more
- 20 GB free disk space
- Sudo user with admin access
- Reliable Internet Connectivity
- Docker, VirtualBox, or KVM
Now, let’s jump into the Minikube installation steps.
How to Install Minikube on Ubuntu 22.04
- Before starting the Minikube installation, it is recommended to install all available updates on your system. Run the following commands:
$ sudo apt update $ sudo apt upgrade -y
Copy CodeOnce all the updates are installed, reboot the system:
$ sudo reboot
Copy Code - Minikube requires either Docker or VirtualBox. Here, we will be installing Docker on the Ubuntu 22.04 system. Run the following set of commands to add the Docker apt repository:
$ sudo apt install ca-certificates curl gnupg wget apt-transport-https -y $ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg $ echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null $ sudo apt update
Copy Code - Next, install Docker by running the following command:
$ sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Copy Code - Then, add the local user to the Docker group so that the local user can run Docker commands without `sudo`:
$ sudo usermod -aG docker $USER $ newgrp docker
Copy CodeWe can apply the changes, by logging out and logging back in.
- To download and install the Minikube binary, run the following commands:
$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 $ sudo install minikube-linux-amd64 /usr/local/bin/minikube
Copy CodeWe can verify the Minikube version by running:
$ minikube version
Copy Code - Kubectl is a command-line tool used to interact with the Kubernetes cluster. We can install Kubectl, with this command:
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
Copy Code - Next, set executable permissions on it and move it to `/usr/local/bin`:
$ chmod +x kubectl $ sudo mv kubectl /usr/local/bin/
Copy Code - Verify the Kubectl version by running:
$ kubectl version -o yaml
Copy Code - Now that Minikube is installed, start a Kubernetes cluster using the following command:
$ minikube start –driver=docker
Copy CodeThis command initializes a single-node Kubernetes cluster and might take a few minutes to download the necessary components.
- Once Minikube has started, verify the status of the cluster by running:
$ minikube status
Copy Code - Now, we can use Kubectl to interact with our Minikube Kubernetes cluster. For example, we can check the nodes in our cluster:
$ kubectl get nodes $ kubectl cluster-info
Copy CodeWe can deploy a sample Nginx deployment by running the following set of commands:
$ kubectl create deployment nginx-web --image=nginx $ kubectl expose deployment nginx-web --type NodePort --port=80 $ kubectl get deployment,pod,svc
Copy Code - To add additional functionality to our Kubernetes cluster, we can enable add-ons. To view all available add-ons, run:
$ minikube addons list
Copy CodeTo enable add-ons, run:
$ minikube addons enable dashboard $ minikube addons enable ingress
Copy Code - To start the Kubernetes dashboard, run this:
$ minikube dashboard
Copy Code - Finally, ensure that Minikube is active, print out the Minikube status by running this command:
$ minikube status
Copy CodeThe output will display whether Minikube is running.
How to Manage Minikube Cluster
To stop and start the Minikube cluster, run these commands:
$ minikube stop
$ minikube start
Copy Code
To delete the Minikube cluster, run:
$ minikube delete
Copy Code
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
Minikube offers an efficient and user-friendly way to explore Kubernetes capabilities without the need for a full-scale production environment. With the above guide, we can quickly set up a local Kubernetes cluster on Ubuntu 22.04, enabling us to develop, test, and experiment with Kubernetes features in a controlled environment.
In brief, our Support Experts demonstrated how to install Minikube on Ubuntu 22.04.
0 Comments