For the complete documentation index, see llms.txt. This page is also available as Markdown.

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/#docker

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:

Replace 18.06.2 with the latest supported docker version.

Setup firewall

Master

Nodes

References

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

Install kubelet, kubeadm and kubectl

Init cluster

Configure your user to run kubectl:

Deploy Weave Net:

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:

References

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

Dashboard

Deploy the dashboard:

In your workstation...

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

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

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

Install packages, for example:

Hold packages versions:

Run the joint command:

Use your cluster join command.

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/113

Last updated