Ubuntu 20.04
Sponsored Link

Kubernetes : Install Kubeadm2020/08/19

 
Install Kubeadm to Configure Multi Nodes Kubernetes Cluster.
This example is based on the emvironment like follows.
For System requirements, each Node has uniq Hostname, MAC address, Product_uuid.
MAC address and Product_uuid are generally already uniq one if you installed OS on phisical machine or virtual machine with common procedure.
You can see Product_uuid with the command [dmidecode -s system-uuid].
-----------+---------------------------+--------------------------+------------
           |                           |                          |
       eth0|10.0.0.30              eth0|10.0.0.51             eth0|10.0.0.52
+----------+-----------+   +-----------+----------+   +-----------+----------+
|   [ dlp.srv.world ]  |   | [ node01.srv.world ] |   | [ node02.srv.world ] |
|      Master Node     |   |      Worker Node     |   |      Worker Node     |
+----------------------+   +----------------------+   +----------------------+

[1] Install Docker and Apply some requirements on all Nodes.
root@dlp:~#
apt -y install docker.io apt-transport-https
# cgroup driver uses systemd

root@dlp:~# cat > /etc/docker/daemon.json <<EOF
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF

root@dlp:~#
systemctl restart docker

root@dlp:~#
systemctl enable docker
root@dlp:~# cat > /etc/sysctl.d/k8s.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF

root@dlp:~#
sysctl --system
# needs [iptables-legacy] for iptables backend

# if set nftables ot others, change to [iptables-legacy]

root@dlp:~#
update-alternatives --config iptables

There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).

  Selection    Path                       Priority   Status
------------------------------------------------------------
* 0            /usr/sbin/iptables-legacy   20        auto mode
  1            /usr/sbin/iptables-legacy   20        manual mode
  2            /usr/sbin/iptables-nft      10        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

# if swap is On, turn to Off

root@dlp:~#
swapoff -a

root@dlp:~#
vi /etc/fstab
# comment out swap line

#
/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0
[2] Install Kubeadm, Kubelet, Kubectl on all Nodes.
root@dlp:~#
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

OK
root@dlp:~#
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list

root@dlp:~#
apt update

root@dlp:~#
apt -y install kubeadm kubelet kubectl

Matched Content