Centos/RHEL Prerequisites

This document describes CentOS / RHEL specific pre-requisites for a BareOS PMK cluster. It is part of the overall Quick Setup Guide for PMK. If you haven’t already, we recommend starting with that guide first.

Install the Operating System and Update Packages

Install the latest version of RHEL 7 or CentOS 7

Run the following command to update all installed packages.

yum update

Manual Prerequisite

The steps below are completed automatically by the Platform9 CLI. If you would like to manually complete the prerequisites follow the steps below.

Disable firewalld

You need to disable firewalld as there is a known incompatibility between firewalld and docker’s use of iptables. You can find more information on it here: https://github.com/docker/docker/issues/16137.

Run the following command to disable firewalld.

systemctl stop firewalld
systemctl disable firewalld

Disable any other incompatible networking 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.

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 master or 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

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).

Follow the steps given below to prepare docker storage on your node.

Choose a Existing Block Device or Create a New Block Device

See pre-install checklist for recommendations on the size of the disk or partition.

If a free block device is available on the node, note the path of the block device, e.g., /dev/sdb for a disk, /dev/sdc1 for a partition. You will need to specify it later during creation of the LVM thin pool.

If a free block device is not available, create a new block device, then note the block device path. You can create a block device either by attaching a new disk to the node, or creating a new partition on an existing disk. To create a new partition on a disk, use fdisk (man 8 fdisk) and set the partition type to 8e (Linux LVM). See http://tldp.org/HOWTO/Partition/fdisk_partitioning.html for detailed information on creating disk partitions on RHEL/CentOS systems.

Create LVM thin pool on the Block Device

Once a free block deive is available, follow the steps given below to create an LVM thin pool on the block device.

  • Ensure that LVM is installed on the host:
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:
wget https://raw.githubusercontent.com/platform9/support-locker/master/pmk/bd2tp.sh
  • Change the file permissions to make the script executable:
chmod +x bd2tp.sh
  • Run the 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 docker-vg