Installing a 3 node(master) Kubernetes cluster on CentOS 7.5
Below I am going to show you how install, configure a 3 node multi-master Kubernetes 1.11 Cluster
without using kubeadm
, in addition I will also show you how to install/configure 2 worker nodes.
While there are many places describing the Kubernetes
installation process, they mostly use the kubeadm
utility. which is not officially support for a multi-master configuration. in the next few articles, I will be showing you how to configure a Kubernetes
cluster manually without using the kubeadm
With the recent Kubernetes version(s) it is possible to install a multi-master cluster by using the kubeadm
utility, however its still in beta and requires a few workarounds to make it work.
With that said, lets jump right in.
Get going in minutes with a full Kubernetes cluster by using the free Kubernetes generator on my GitHub repository
Version 0.7 just became available of the Kubernetes generator, supporting kubernetes version v.1.13.x+
, RBAC, Auto Bootstraping, and more.
You can generate your own configuration in minutes by using the generator, available on my GitHub repository by going here
, you can also just use the ready examples files available here
This is Part 1
– Installing and configuring kubernetes – Initial setup – bear-metal installation, configuration.
OS Installation / Configuration
To make it easier to understand the Kubernetes
configuration, lets start first with a the Hostname / IP Address digram described below.
Hostname / IP Address diagram used in the below configuration
All the examples below use.
- Oracle VirtualBox to virtualize the Master and Worker nodes.
- CentOS(1804) as the Ber-Metal and Kubernetes VM’s.
The first steps is to Download a CentOS image. In my case I used CentOS 7.5 Minimal(CentOS-7-x86_64-Minimal-1804.iso), install that on your bare-metal server.
If you are behind a corporate firewall or proxy, set the below in /etc/environment and in /etc/yum.conf.
# The proxy server - proxy server:port number
# The account details for yum connections
For our configuration we do not need the Gnome desktop, If you would like to install the Gnome Desktop Just run the below.
yum -y groups install "GNOME Desktop"
# Set Gnome Desktop as default (after next reboot).
systemctl set-default graphical.target
# Enable/start the Gnome Desktop in the current env with a reboot, run
systemctl isolate graphical.target
# Get current settings
Installing / Preparing Oracle VirtualBox for Kubernetes
Since I would like to use the most recent VirtualBox I will be downloading it directory from Oracle i.e using Oracles repo.
To install Oracle VirtualBox, just run the below.
Next, lets install a few VirtualBox pre-requisites.
Run all the below.
yum groupinstall "Development Tools"
yum install kernel-devel
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum --enablerepo=epel install dkms
yum install gcc make patch dkms qt libgomp
yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
Once completed, reboot the server.
Next, install virtualbox by running the below.
yum install VirtualBox-5.2
systemctl enable vboxdrv
systemctl start vboxdrv
usermod -a -G vboxusers user_name
Configuring VirtualBox networking to be used by Kubernetes VM’s
For Kubernetes master’s to work properly, communicated with each other we need to create/configure a VirtualBox managed network.
Just follow the below steps to do so.
The steps below are only required for VirtualBox so that the Kubernetes hosts can communicate properly with each other. in a bear-metal configuration a similar configuration would be required on your regular switches.
Virtual Box host network manager
Virtual Box preferences > network
Virtual Box preferences > NAT
Virtual Box preferences > Port-forward (3 masters and 3 nodes)
Virtual Box VM > Network
To access any of the VirtualBox VM’s you can just ssh with the -p
option, for example to access the first VM on port 2011, use the below.
ssh localhost -p 2011
In Part 2
will continue installing / configuring the Kubernetes VM’s and etcd.
You might also like – Other related articles to Docker and Kubernetes / micro-service
Like what you’re reading? please provide feedback, any feedback is appreciated.