Bare-metal

Install a cluster using Kubeadm on bare-metal servers

Install docker

Check which Docker version Kubernetes supports: https://kubernetes.io/docs/setup/cri/#dockerarrow-up-right

By the time of this writing, the latest supported docker version is 18.06.2.

Install dependencies:

sudo apt-get -y install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Add the repo:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Install Docker:

circle-info

Replace 18.06.2 with the latest supported docker version.

Setup firewall

Master

Nodes

References

https://kubernetes.io/docs/setup/independent/install-kubeadm/arrow-up-right

Install kubelet, kubeadm and kubectl

Init cluster

circle-exclamation
circle-exclamation

Configure your user to run kubectl:

Deploy Weave Net:

circle-exclamation

Confirm that all of the pods are running with the following command.

Wait until each pod has the STATUS of Running.

Confirm that master node is ready:

circle-exclamation

References

https://dzone.com/articles/deploying-kubernetes-dashboard-to-a-kubeadm-createarrow-up-right https://zihao.me/post/creating-a-kubernetes-cluster-from-scratch-with-kubeadm/arrow-up-right https://chrislovecnm.com/kubernetes/cni/choosing-a-cni-provider/arrow-up-right https://docs.projectcalico.org/v3.5/getting-started/kubernetes/arrow-up-right

Dashboard

Deploy the dashboard:

In your workstation...

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/arrow-up-right

Create dashboard user: https://devops-buzz.gitbook.io/public/kubernetes/dashboard#create-userarrow-up-right

Join node

Install kubelet, kubeadm and kubectl.

Setup Docker cgroupdriver systemd

Check docker systemd service config file:

Sample output:

Edit the file:

Add --exec-opt native.cgroupdriver=systemd to the ExecStart option:

Restart daemon:

Add node to the cluster

circle-exclamation

Install packages, for example:

Hold packages versions:

circle-exclamation
circle-exclamation

Run the joint command:

circle-info

Use your cluster join command.

circle-info

If by any chance you need to run the join command more than one time and you the certificate FileAvailable--etc-kubernetes-pki-ca.crt, run this command before:

You should see this output:

Go to your master server and label the new node:

Remove node

List your current nodes:

Output example:

Let's suppose you want to remove the node ip-172-31-9-145:

Check node status:

Output example:

Then, on the node being removed, reset all kubeadm installed state::

The reset process does not reset or clean up iptables rules or IPVS tables. If you wish to reset iptables, you must do so manually:

If you want to reset the IPVS tables, you must run the following command:

Kubeadm over VPN

https://github.com/kubernetes/kubeadm/issues/113arrow-up-right

Last updated