More details can be found from its official documentation: http://kubernetes.io/docs/getting-started-guides/

Installing Kubernetes on Linux with kubeadm

Virtual Machines:

|: —- VMs —- :|: — Size — :|
| kub1 - CentOS 7 | 2 Cores 8 GB Mem |
| kub2 - CentOS 7 | 2 Cores 8 GB Mem |
| kub3 - CentOS 7 | 2 Cores 8 GB Mem |

Instructions

(1/4) Installing kubelet and kubeadm on your hosts

You will install the following packages on all the machines:

  • docker: the container runtime, which Kubernetes depends on. v1.11.2 is recommended, but v1.10.3 and v1.12.1 are known to work as well.
  • kubelet: the most core component of Kubernetes. It runs on all of the machines in your cluster and does things like starting pods and containers.
  • kubectl: the command to control the cluster once it’s running. You will only need this on the master, but it can be useful to have on the other nodes as well.
  • kubeadm: the command to bootstrap the cluster.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
yum update

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

setenforce 0
yum install -y docker kubelet kubeadm kubectl kubernetes-cni
systemctl enable docker && systemctl start docker
systemctl enable kubelet && systemctl start kubelet
1
2
3
4
5
6
tee -a /etc/hosts << '__EOF__'

10.1.0.4 kub1
10.1.0.5 kub2
10.1.0.6 kub3
__EOF__