Post

Multi-CPU Architecture Kubernetes Cluster with a Raspberry Pi

Building a Multi-architecture CPU Kubernetes cluster is easier than you think with k3s.In this video we’ll build a Raspberry Pi 4 with an ARM CPU and add it to our existing x86 x64 amd64 CPU Kubernetes cluster.Our foundation will be Ubuntu for ARM, then we’ll add k3s, and then join it to our cluster.We’ll also discuss how this works with Docker images built for specific CPU types.We’ll also talk about some build configurations and requirements for your Pi.

Happy Pi Day!

📺 Watch Video

1
k3s --version

get k3s token from a server

1
sudo cat /var/lib/rancher/k3s/server/node-token

set k3s version (the value you got from k3s --version)

1
 export INSTALL_K3S_VERSION=v1.20.5+k3s1

install k3s as an agent using your token from above

1
curl -sfL https://get.k3s.io | K3S_URL=https://example.local.com:6443 K3S_TOKEN=hksadhahdklahkadjhasjdhasdhasjk::server:asljkdklasjdaskdljaskjdlasj sh -

check all k3s nodes from your workstation

1
kubectl get nodes

get all pods running on a specific node (elio)

1
kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=elio

set a label on a node (elio)

1
kubectl label nodes elio cputype=arm

describe a node (elio)

1
kubectl describe node elio

Example pod spec

nginx-pod.yml

1
2
3
4
5
6
7
8
9
10
11
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  nodeSelector:
    cputype: arm64

⚙️ See all the hardware I recommend at https://l.technotim.live/gear

🚀 Don’t forget to check out the 🚀Launchpad repo with all of the quick start source files

This post is licensed under CC BY 4.0 by the author.