rramos.github.io

26 Aug, 2023 - About 2 minutes

Local Kubernetes for Testing/Developing

Intro

minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.

Lets start by installing the minikube package.

NOTE: This example is targeting a Arch distribution, if you use a different linux flavor check the Official Docs for other install options

sudo pacman -S minikube

The following command will setup a docker environment with a kubernetes environment that you can use for development/testing purposes

minikube start

In order to interact with Kubernetes one can use the provided kubectl command upon starting this environment with the following command

minikube kubectl -- get pods -A

One should get something like this

NAMESPACE     NAME                               READY   STATUS    RESTARTS      AGE
kube-system coredns-787d4945fb-zv72d 1/1 Running 0 10m
kube-system etcd-minikube 1/1 Running 0 10m
kube-system kube-apiserver-minikube 1/1 Running 0 10m
kube-system kube-controller-manager-minikube 1/1 Running 0 10m
kube-system kube-proxy-7p9qw 1/1 Running 0 10m
kube-system kube-scheduler-minikube 1/1 Running 0 10m
kube-system storage-provisioner 1/1 Running 1 (10m ago) 10m

I will install kubectl package however to allow interaction with other clusters if required.

sudo pacman -S kubectl

We should get the same output by executing

kubectl get po -A

One can check the cluster details with following command

kubectl cluster-info

You should get something similar

Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Minikube is also bundled with Kubernetes Dashboard which you can launch with the following command

minikube dashboard

You would get something similar to the following image:

Great now we have a Kubernetes cluster running in docker and kubectl command available.

For a more extensive guideline on how to manage Minikube please checkout the handbook

Next steps would containerize some application and deploy it.

But that would be for another article…

References

OLDER > < NEWER