Building a Kubernetes 1.27 Cluster with kubeadm

Install Packages

Control Pane Node

Create the configuration file for containerd:

cat << EOF | sudo tee /etc/modules-load.d/containerd.conf 
overlay 
br_netfilter 
EOF

Load the modules:

Set the system configurations for Kubernetes networking:

Apply the new settings:

Install containerd:

Create the default configuration file for containerd:

Generate the default containerd configuration, and save it to the newly created default file:

Restart containerd to ensure the new configuration file is used:

Verify that containerd is running:

Disable swap:

Install the dependency packages:

Download and add the GPG key:

Add Kubernetes to the repository list:

Update the package listings:

Install Kubernetes packages:

Note: If you get a dpkg lock message, just wait a minute or two before trying the command again.

Turn off automatic updates:

Worker Node

Create the configuration file for containerd:

Load the modules:

Set the system configurations for Kubernetes networking:

Apply the new settings:

Install containerd:

Create the default configuration file for containerd:

Generate the default containerd configuration, and save it to the newly created default file:

Restart containerd to ensure the new configuration file is used:

Verify that containerd is running:

Disable swap:

Install the dependency packages:

Download and add the GPG key:

Add Kubernetes to the repository list:

Update the package listings:

Install Kubernetes packages:

Note: If you get a dpkg lock message, just wait a minute or two before trying the command again.

Turn off automatic updates:

Initialize the Cluster

Control Pane Node

Initialize the Kubernetes cluster on the control plane node using kubeadm:

Set kubectl access:

Test access to the cluster:

Install the Calico Network Add-On

Control Pane Node

On the control plane node, install Calico Networking:

Check the status of the control plane node:

Join the Worker Nodes to the Cluster

Control Pane Node

In the control plane node, create the token and copy the kubeadm join command:

Worker Node

You can just copy the output from the previous command on the Control Pane Node but add sudo first and it will look similar to this:

In both worker nodes, paste the full kubeadm join command to join the cluster. Use sudo to run it as root:

Control Pane Node

In the control plane node, view the cluster status:

Last updated