kubernetes in centos 8

The other day it occured to to install kubernetes with 2 VMs running in virtualbox. I always want to be in the bleeding edge, longer support time, but more problems and less documentation.

For my install I decided to use Centos 8 which was just release this year in Sept 29th. To start the OS install, has some changes but minimal.

The other new pains where a bit more around installation of docker and setup of kubernetes, in this post I intend to provide you with some information and links, but not the details steps.

The official install guide

The official set of instructions to install kubernetes can be found here, I didn’t use this steps until I got to the part of installing the network plugin Calico: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#instructions

Get started with the install…

Problem #1 my guide was not great…

Maybe because the guide is based for CentOs7, but I found missing pieces.

I started the install following the linuxtechi by Pradeep Kumar, but soon found problems with docker install and missing the steps for network plugin for k8s. I liked because it has a diagram and names the VMs like k8s-master and worker-node1 which makes it easy to follow. Use it to follow the overall steps, as a guide to a guide, but as mentioned there are missing steps for which you will need my other links below: https://www.linuxtechi.com/install-kubernetes-1-7-centos7-rhel7/.

A more complete guide is perhaps this one, but I can’t say that I have reviewed all the steps as I used Pradeep’s: https://www.howtoforge.com/tutorial/centos-kubernetes-docker-cluster/

Installing Docker

Problem #2: latest docker is not able to install

For installing docker in Centos 8, you will be unable to use the latest docker-ce 3:19.03.4-3.el7 due to missing dependancies.

   [root@node1 ~]# dnf install docker-ce
Last metadata expiration check: 15:53:53 ago on Sat 09 Nov 2019 03:09:35 PM EST.
 Problem: package docker-ce-3:19.03.4-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - cannot install the best candidate for the job
  - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.el7.x86_64 is excluded
  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

So you need to install a specific version of docker, for that I did find a good guide and updated to Centos 8: https://www.techrepublic.com/article/how-to-install-docker-ce-on-centos-8/

After those two problems you are good with the steps and your k8s should be ready to use.

Problems with a 2 network interface in virtualbox

On the side, I did find a bit of a challenge setup the 2 network device inside of my VM. And for that I had to use nmcli connection show and copy the details of a working connection and use them in nmcli connection add -a I am cutting corners here, but I don’t want to cover the details here as this was a separate problem. Related to virtualbox and the way that host-only networks work with centos8.