It’s time to learn Kubernetes, in fact, it’s probably past time. I’ve been working my way through Sander Van Vugt’s incredible Certified Kubernetes Application Developer(CKAD) video course and needed a test environment to apply what I’m learning. His course materials supply Minikube in a VirtualBox VM, and there’s nothing wrong with that. But since I’ve already got a perfectly good libvirt installation on my CentOS 8 server I wanted to stand Minikube up there. The installation steps available at https://minikube.sigs.k8s.io/docs/start/ got me exactly where I needed to be in about 15 minutes. Here’s what I did:
- Download latest minicube package:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
- Install:
- sudo
yum localinstall minikube-latest.x86_64.rpm
- sudo
- Validate your libvirt install. If you’re already running other virtual machines you should get nearly all greens with this check:
virt-host-validate
- Edit /etc/libvirt/libvirtd.conf with the following values:
unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"
- Restart libvirtd:
sudo systemctl restart libvirtd
- Choose an unprivileged account to use with Minikube, I’ll use dan:
sudo usermod -aG libvirt dan
- Run Minikube with the kvm2 driver:
minikube start --driver=kvm2
- Run minikube status to see how we did, my output looks like this:
[dan@r2d2 ~]$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
timeToStop: Nonexistent
The kubectl
command will provide your primary interface to Minikube. I received a ‘command not found’ type error the first time I tried it after this install. It turns out the command was buried way down in my ~/.minikube directory so I just created a link to it in a directory on my $PATH.
ln -s /home/dan/.minikube/cache/linux/v1.20.0/kubectl /home/dan/.local/bin/kubectl
Good output from the kubectl version
will confirm success.
Cheers, dcd