Performing prerequisite tasks

Before we begin installing and setting up our Kubernetes, here are a few prerequisites tasks:

  1. Install socat. For Helm, socat is used to set the port forwarding for both the Helm client and Tiller:
# yum -y install socat
  1. Set SELINUX=disabled in /etc/selinux/config and then reboot for it to take effect. After the reboot, you should get an output from getenforce as permissive:
# getenforce
Disabled
  1. Add the Docker repository:
# yum -y install yum-utils
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  1. Install Docker. Since we will be working with Kubernetes 1.15.6, the tested version of Docker for this release is 3:18.09.8-3.el7.

We will switch the Docker cgroup driver from cggroupfs to systemd:

# mkdir -p /etc/docker
# cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
}, "storage-driver": "overlay2" }
EOF
  1. You can find an available version using yum --showduplicates list docker-ce:
# yum -y install docker-ce-cli-18.09.8-3.el7.x86_64
# yum -y install docker-ce-18.09.8-3.el7.x86_64
# systemctl enable docker
# systemctl start docker
  1. Optionally, you can configure a separate disk to mount /var/lib/docker and restart Docker.
  2. Now check docker version:
# docker version
Client:
Version: 18.09.8
API version: 1.39
Go version: go1.10.8
Git commit: 0dd43dd87f
Built: Wed Jul 17 17:40:31 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.8
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 0dd43dd
Built: Wed Jul 17 17:10:42 2019
OS/Arch: linux/amd64
Experimental: false

Make sure that you have Docker 18.09.8 and not the higher version.

  1. Check whether the storage driver is overlay2 and the cgroup driver is systemd.
# docker info | grep -E "Cgroup|Storage Driver"
Storage Driver: overlay2
Cgroup Driver: systemd

That's it! Now we're ready to build our Kubernetes using our VM. So, let's dive straight in.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.80.45