# Setting up Minikube on Thinkpad X220 Today, I was setting up Minikube on Thinkpad X220 running Ubuntu. ## Enable and install KVM 1. Boot systems to BIOS with the F1 key at power on. 2. Select the Security tab in the BIOS. 3. Enable Intel VTT and Intel VT-d. Follow instructions from https://help.ubuntu.com/community/KVM/Installation. Check that your CPU supports hardware virtualization. To run KVM, you need a processor that supports hardware virtualization. Intel and AMD both have developed extensions for their processors, deemed respectively Intel VT-x (code name Vanderpool) and AMD-V (code name Pacifica). To see if your processor supports one of these, you can review the output from this command: ```bash $ egrep -c '(vmx|svm)' /proc/cpuinfo 8 $ kvm-ok INFO: /dev/kvm exists KVM acceleration can be used ``` Install packages: ```bash $ sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils ``` Add your user to kvm groups: ```bash $ sudo adduser `id -un` libvirt Adding user '<username>' to group 'libvirt' ... $ sudo adduser `id -un` kvm Adding user '<username>' to group 'kvm' ... ``` Verify installation: ```bash $ virsh list --all Id Name State ---------------------------------- $ virt-host-validate QEMU: Checking for hardware virtualization : PASS QEMU: Checking if device /dev/kvm exists : PASS QEMU: Checking if device /dev/kvm is accessible : PASS QEMU: Checking if device /dev/vhost-net exists : PASS QEMU: Checking if device /dev/net/tun exists : PASS QEMU: Checking for cgroup 'cpu' controller support : PASS QEMU: Checking for cgroup 'cpuacct' controller support : PASS QEMU: Checking for cgroup 'cpuset' controller support : PASS QEMU: Checking for cgroup 'memory' controller support : PASS QEMU: Checking for cgroup 'devices' controller support : PASS QEMU: Checking for cgroup 'blkio' controller support : PASS QEMU: Checking for device assignment IOMMU support : PASS QEMU: Checking if IOMMU is enabled by kernel : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments) QEMU: Checking for secure guest support : WARN (Unknown if this platform has Secure Guest support) LXC: Checking for Linux >= 2.6.26 : PASS LXC: Checking for namespace ipc : PASS LXC: Checking for namespace mnt : PASS LXC: Checking for namespace pid : PASS LXC: Checking for namespace uts : PASS LXC: Checking for namespace net : PASS LXC: Checking for namespace user : PASS LXC: Checking for cgroup 'cpu' controller support : PASS LXC: Checking for cgroup 'cpuacct' controller support : PASS LXC: Checking for cgroup 'cpuset' controller support : PASS LXC: Checking for cgroup 'memory' controller support : PASS LXC: Checking for cgroup 'devices' controller support : PASS LXC: Checking for cgroup 'freezer' controller support : PASS LXC: Checking for cgroup 'blkio' controller support : PASS LXC: Checking if device /sys/fs/fuse/connections exists : PASS ``` Restart the machine as logout and the kernel modules restart didn’t work for me. ## Install Minikube Follow instructions from https://minikube.sigs.k8s.io/docs/start/. Download minikube binary: ```bash $ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 $ sudo install minikube-darwin-amd64 /usr/local/bin/minikube ``` Make KVM the default driver ```bash $ minikube config set driver kvm2 ❗ These changes will take effect upon a minikube delete and then a minikube start ``` Start minikube: ```bash $ minikube start 😄 minikube v1.17.1 on Ubuntu 20.04 ✨ Using the kvm2 driver based on existing profile 👍 Starting control plane node minikube in cluster minikube 💾 Downloading Kubernetes v1.20.2 preload ... 🏃 Updating the running kvm2 "minikube" VM ... 🐳 Preparing Kubernetes v1.20.2 on Docker 20.10.2 ... ▪ Generating certificates and keys ... ▪ Booting up control plane ... ▪ Configuring RBAC rules ... 🔎 Verifying Kubernetes components... 🌟 Enabled addons: default-storageclass, storage-provisioner 💡 kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A' 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default ``` Install `kubectl`: ```bash $ sudo snap install kubectl --classic ``` Now, we can check which pods are running inside the cluster: ```bash $ kubectl get po -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-74ff55c5b-jzj8w 1/1 Running 0 2m40s kube-system etcd-minikube 1/1 Running 0 2m49s kube-system kube-apiserver-minikube 1/1 Running 0 2m49s kube-system kube-controller-manager-minikube 1/1 Running 0 2m49s kube-system kube-proxy-xdlr2 1/1 Running 0 2m40s kube-system kube-scheduler-minikube 1/1 Running 0 2m49s kube-system storage-provisioner 1/1 Running 0 2m55s ``` Later in the day, I was interviewed by Pius from the Recurse Center. We talked about my motivation for joining the program. Apparently, I’ve been talking too much about meta-stuff, but I’m glad that at the end Pius asked me about more practical things. I briefly explained what Diggy is and what could be the next reasonable goal. A few hours later, I received an email telling me that I passed the first round and asking me to work on one of the pair programming tasks. I decided to build a simple Space Invaders game. For the rest of the day, I was thinking about architecture.