DEV Community

Arseny Zinchenko
Arseny Zinchenko

Posted on • Originally published at rtfm.co.ua on

Kubernetes: running Minikube on Arch Linux

Minikube – a utility to run a Kubernetes cluster locally on your PC.

It can use Virtualbox, VMware, Hyper-V etc hypervisors which will be used to create a virtual machine with a Kubernetes cluster.

Minikube is a great tool for developers or DevOps engineers to test deployments/services etc without the need to create and conigure a real cluster.

In the post below – a quick HowTo install it and run a Kubernetes pod using the Minikube.

In Arch Linux can be installed from AUR:

$ yaourt -S minikube
Enter fullscreen mode Exit fullscreen mode

If you haven’t Virtualbox yet – install it, here it will be used for Minikube:

$ sudo pacman -S virtualbox
Enter fullscreen mode Exit fullscreen mode

minikube will work with Kubernetes via kubectl – install it as well:

$ yaourt -S kubectl
Enter fullscreen mode Exit fullscreen mode

Now check it.

Start Minikube itself:

$ minikube start
 [😄] minikube v0.35.0 on linux (amd64)
 [🔥] Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
 [💿] Downloading Minikube ISO ...
184.42 MB / 184.42 MB [============================================] 100.00% 0s
 [📶] "minikube" IP address is 192.168.99.100
 [🐳] Configuring Docker as the container runtime ...
 [✨] Preparing Kubernetes environment ...
 [💾] Downloading kubelet v1.13.4
 [💾] Downloading kubeadm v1.13.4
 [🚜] Pulling images required by Kubernetes v1.13.4 ...
 [🚀] Launching Kubernetes v1.13.4 using kubeadm ...
 [⌛] Waiting for pods: apiserver proxy etcd scheduler controller addon-manager dns
 [🔑] Configuring cluster permissions ...
 [🤔] Verifying component health .....
 [💗] kubectl is now configured to use "minikube"
 [🏄] Done! Thank you for using minikube!
Enter fullscreen mode Exit fullscreen mode

Check Virtualbox VMs running:

$ VBoxManage list runningvms
"minikube" {37da5f2d-c486-4419-a152-eb5dcedde6f3}
Enter fullscreen mode Exit fullscreen mode

Create a new pod:

$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/hello-minikube created
Enter fullscreen mode Exit fullscreen mode

Run the service:

$ kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
Enter fullscreen mode Exit fullscreen mode

List pods:

$ kubectl get pod
NAME                              READY   STATUS    RESTARTS   AGE
hello-minikube-5857d96c67-x46nk   1/1     Running   0          74s
Enter fullscreen mode Exit fullscreen mode

And check the service itself:

$ curl $(minikube service hello-minikube --url)
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/

SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001

HEADERS RECEIVED:
accept=*/*
host=192.168.99.100:31345
user-agent=curl/7.64.0
BODY:
-no body in request-
Enter fullscreen mode Exit fullscreen mode

After you’ll finish – stop and delete VMs, pods, and services:

$ minikube stop
 [✋] Stopping "minikube" in virtualbox ...
 [🛑] "minikube" stopped.
Enter fullscreen mode Exit fullscreen mode

Done.

Similar posts

Top comments (1)

Collapse
 
northbear profile image
northbear

Well done... I prefer to run the minikube with Podman engine, kinda full open source solution and get up faster than with VB.