Before we begin installing and setting up our Kubernetes, here are a few prerequisites tasks:
- Install socat. For Helm, socat is used to set the port forwarding for both the Helm client and Tiller:
# yum -y install socat
- 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
- Add the Docker repository:
# yum -y install yum-utils
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- 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
- 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
- Optionally, you can configure a separate disk to mount /var/lib/docker and restart Docker.
- 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.
- 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.