Template

Kubernetes Node Setup

A Kubernetes worker ready to join a cluster, or a new control plane with a pod network.

Steps, in order · version 1.0

  1. Update Packages
  2. Install Kubernetes

Options

As they appear on the run form, with their defaults.

Kubernetes version

One choice

Every server in a cluster should run the same one.

  • 1.37 (newest)
  • 1.36
  • 1.35

Default: 1.37 (newest)

Role

One choice

A control plane needs at least 2 CPUs and 2 GB of memory.

  • Worker node, ready to join a cluster
  • Control plane, starting a new cluster

Default: Worker node, ready to join a cluster

Pod network

One choice

For a control plane. Flannel is the simplest; Calico also enforces network policies.

  • Flannel
  • Calico

Default: Flannel

Run workloads on the control plane

On or off

For a cluster of one server.

Default: Off

What you get

An up-to-date server with containerd, kubelet, kubeadm and kubectl, set up the way the Kubernetes documentation describes for kubeadm. A worker is left ready to join a cluster. A control plane is started with kubeadm, gets Flannel or Calico as its pod network, and is Ready when the run ends.

Building a cluster

  1. Run this template on one server with Role set to Control plane, starting a new cluster. It needs at least 2 CPUs and 2 GB of memory.
  2. Run it on every other server with Role set to Worker node, ready to join a cluster, with the same Kubernetes version.
  3. On the control plane, over SSH, run kubeadm token create --print-join-command --ttl 1h, and run the command it prints on each worker over SSH.
  4. On the control plane, kubectl get nodes lists every server as Ready within a few minutes.

For a cluster of one server, run step 1 with Run workloads on the control plane on.

Choosing the options

Kubernetes version — 1.37, 1.36 or 1.35. The same on every server.

Role — control plane or worker, as above.

Pod networkFlannel for the simplest setup, Calico for network policies. Used by the control plane; workers get it from the cluster when they join.

Run workloads on the control plane — for a one-server cluster.

The Install Kubernetes page explains each option and every change made to the server, including the firewall ports opened when firewalld or ufw is active.

What happens

  1. Update Packages.
  2. Install Kubernetes.

After the run

The join command is never shown in the run, because it carries a token that lets any machine join the cluster; that is why step 3 above uses SSH. To use kubectl from your own computer, copy /etc/kubernetes/admin.conf from the control plane and keep it as safe as a password.

Common problems

  • A control plane needs at least 2 CPUs and 1700 MB of memory — use a larger server for the control plane.
  • This server uses cgroup v1 — Kubernetes 1.35 and later need cgroup v2.
  • A worker stays NotReady — its pod network pod is still starting, or it cannot reach the control plane on port 6443.

The Install Kubernetes page lists every error the playbook can report and what to do.