Minikube
Contents
This section briefly describes how to install and set up minikube for testing the operator.
Prerequisites
You need to have installed these programs on your computer:
- Minikube
-
Is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes. Download it here.
- Docker
-
Is a container management platform. You can use other virtual machine or container managers with Minikube, but Docker is the most preferable Minikube driver across all operating systems. Download it here.
- Kubectl
-
Is the Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. Download it here.
Setup
Once you have minikube working, it is quite easy to start a local cluster.
The amount of resources you allocate to minikube will depend on your computer’s capacity and the workload you intend to run on the cluster. |
$ minikube start \
--cpus=4 \
--memory=16gb \
--disk-size=10gb \
--vm-driver=docker \
--kubernetes-version=v1.27.0
* Preparing Kubernetes v1.27.0 on Docker 27.2.0 ...
- Generating certificates and keys ...
- Booting up control plane ...
- Configuring RBAC rules ...
* Verifying Kubernetes components...
* Enabled addons: storage-provisioner, default-storageclass
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
When your cluster is up, it is good to add the ingress controller to it to test load balancing:
$ minikube addons enable ingress
* Verifying ingress addon...
* The 'ingress' addon is enabled
Verify
Verify your setup by running:
$ kubectl cluster-info
Kubernetes control plane is running at https://192.168.99.252:8443
KubeDNS is running at https://192.168.99.252:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Teardown
Once you are done with your cluster, you can delete the machine and all the data by running:
$ minikube delete
* Deleting "minikube" in docker ...
* Removed all traces of the "minikube" cluster.