Operating System Specific Prerequisites

Before you can run Platform9 Managed Kubernetes on a physical or virtual node, you must prepare the node for it.

Read through and follow the general requirements checklist related to the memory and networking prerequisites for Platform9 Managed Kubernetes.

Once the prerequisites are met, follow the steps given below to prepare your CentOS or RHEL 7 host ready for Platform9 Managed Kubernetes.

Operating System Install

To prepare a physical or virtual node to be part of a bare metal Kubernetes cluster:

  • Install the latest version of the operating system using a base or minimal package set.
  • Update all packages to receive the latest security and bug fixes.

Update CentOS/RHEL

For CentOS or RHEL 7, run the following command to update all installed packages.

yum update

Install Required Dependencies and Update Ubuntu

For Ubuntu, run the following command to install required dependencies and update all installed packages.

 apt-get update \
 apt-get install curl uuid-runtime \
 apt-get upgrade

Disable Incompatible Services

Ensure that there is no other external / incompatible networking software running on the node as it can interfere with Docker and Kubernetes networking services.

The firewalld service must be disabled. There is a known incompatibility between firewalld and docker’s use of iptables. It is documented at https://github.com/docker/docker/issues/16137.

Run the following command to disable firewalld.

systemctl stop firewalld
systemctl disable firewalld

Disable Swap

Starting Kubernetes version 1.8, all Kubernetes master and worker nodes are expected to have swap disabled. This is the recommended deployment as mentioned in the Kubernetes changelog.

If swap is not disabled, kubelet service will not start on the masters and worker nodes.

Run the following command to disable swap immediately:

 sudo swapoff -a 

Run the following command to update fstab to persist disabling swap across reboots of the node.

sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

The above command comments out all swap entries in the /etc/fstab file.

Prepare Docker Storage

You can either use block storage or an LVM pool for docker storage.

Follow the steps given below to prepare docker storage.

Choose Block Device or Create Block Device

On CentOS/RHEL 7, docker uses the devicemapper storage driver, by default, to manage container images and disk layers. For production, the storage driver must be configured to use direct-lvm mode (The loop-lvm mode is acceptable for testing, but is not supported for production deployments). The direct-lvm mode requires one free block device (a disk or a partition).

If a free block device is available, note the path of the block device, e.g., /dev/sdb for a disk, /dev/sdc1 for a partition.

If a free block device is not available, create a new block device, then note the block device path. You can attach a new disk, or create a new partition. The block device should be at least 40 GB in size. Attaching a new disk is outside the scope of these instructions. To create a new partition, use fdisk (man 8 fdisk). Set the partition type to 8e (Linux LVM). See http://tldp.org/HOWTO/Partition/fdisk_partitioning.html for detailed information on fdisk.

Create LVM thin pool

Follow the steps given below to create an LVM thin pool.

  • Ensure that LVM is installed on the host by running the following command.
yum list installed lvm2

The lvm2 package should be listed as installed. If it is not installed, run the following command to install the lvm2 package.

yum install lvm2
  • Download the bash script to create an LVM thin pool from GitHub by running the following command.
wget https://raw.githubusercontent.com/platform9/support-locker/master/pmk/bd2tp.sh 
  • Change the file permissions of the downloaded shell script so that it can be run.
chmod +x bd2tp.sh
  • Run the downloaded bash script with the path of the free block device chosen or created above and the name of the volume group.
./bd2tp.sh <block_device_name> <volume_group_name>