Skip to content

Commit

Permalink
- updated raspbian to latest stable (2020-02-14) because pi 4B 8G bou…
Browse files Browse the repository at this point in the history
…ght 15/03/2021 complained for too old firmware

- updated kubernetes version to latest stable (1.20.4)
- updated flannel to latest stable (0.13.0)
- fixed haproxy.cfg bug where haproxy complained about equal backend and frontend names
- fixed kubeadm init error wrongly reporting insufficient memory on pi 4B 8GiB (known bug #kubernetes/kubeadm/issues/2365)
  • Loading branch information
Alessandro Accardo committed Mar 18, 2021
1 parent 8fc5b17 commit 6f12f5d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ WIFI_SSID ?=
WIFI_PASSWORD ?=

# Raspbian image configuration
RASPBIAN_VERSION = raspbian_lite-2019-09-30
RASPBIAN_IMAGE_VERSION = 2019-09-26-raspbian-buster-lite
RASPBIAN_VERSION = raspbian_lite-2020-02-14
RASPBIAN_IMAGE_VERSION = 2020-02-13-raspbian-buster-lite
RASPBIAN_URL = https://downloads.raspberrypi.org/raspbian_lite/images/$(RASPBIAN_VERSION)/$(RASPBIAN_IMAGE_VERSION).zip

##@ Build
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ used to build the SD cards:
- Linux - Because of filesystem requirements
- `bash` - 4.0+
- `make` - 4.1+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - 1.16.1
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - 1.20.4
- 4 Raspberry Pis (3 Masters and 1 Worker)

## Applications
Expand All @@ -25,12 +25,12 @@ using `haproxy` and `keepalived` for cluster management.

See below for a list of the versions and applications used:

- [Raspbian](https://downloads.raspberrypi.org/raspbian_lite/images/) - raspbian_lite-2019-09-30
- [Kubernetes](https://kubernetes.io/) - 1.16.1
- [Raspbian](https://downloads.raspberrypi.org/raspbian_lite/images/) - raspbian_lite-2020-02-14
- [Kubernetes](https://kubernetes.io/) - 1.20.4
- [Docker](https://www.docker.com/) - 19.03.9
- [HA Proxy](http://www.haproxy.org/) - 1.8.19
- [Keepalived](https://www.keepalived.org/) - 2.0.10
- [Flannel](https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml) - As per instructions on kubeadm installation page
- [Flannel](https://raw.githubusercontent.com/flannel-io/flannel/v0.13.0/Documentation/kube-flannel.yml) - As per instructions on kubeadm installation page

## Configuration

Expand Down
7 changes: 4 additions & 3 deletions raspbernetes/conf/kubernetes.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
set -euo pipefail

flannel_version="2140ac876ef134e0ed5af15c65e414cf26827915"
flannel_url="https://raw.githubusercontent.com/coreos/flannel/${flannel_version}/Documentation/kube-flannel.yml"
flannel_version="v0.13.0"
flannel_url="https://raw.githubusercontent.com/flannel-io/flannel/${flannel_version}/Documentation/kube-flannel.yml"
pi_home="/home/pi"
kube_finished="${pi_home}/kube-finished-booting"

Expand Down Expand Up @@ -118,7 +118,8 @@ init_master() {
--pod-network-cidr "10.244.0.0/16" \
--control-plane-endpoint "${KUBE_MASTER_VIP}:6443" \
--skip-token-print \
--skip-certificate-key-print
--skip-certificate-key-print \
--ignore-preflight-errors=Mem

# setup flannel
kubectl --kubeconfig=/etc/kubernetes/admin.conf apply -f "${flannel_url}"
Expand Down
4 changes: 2 additions & 2 deletions raspbernetes/install/docker.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -euo pipefail

docker_version="5:19.03.9~3-0~raspbian-stretch"
docker_version="5:19.03.9~3-0~raspbian-buster"

# add repo list
curl -fsSL https://download.docker.com/linux/raspbian/gpg | apt-key add -
cat << EOF >> /etc/apt/sources.list.d/docker.list
deb [arch=armhf] https://download.docker.com/linux/raspbian stretch stable
deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable
EOF

# update mirrors and install docker
Expand Down
4 changes: 2 additions & 2 deletions raspbernetes/install/haproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ frontend kube-api
mode tcp
option tcplog
timeout client 4h
default_backend kube-api
default_backend kube-api-be
backend kube-api
backend kube-api-be
mode tcp
option tcp-check
timeout server 4h
Expand Down
2 changes: 1 addition & 1 deletion raspbernetes/install/kubernetes.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail

kube_version="1.16.1-00"
kube_version="1.20.4-00"
kube_packages=("kubelet=${kube_version}" "kubectl=${kube_version}" "kubeadm=${kube_version}")

echo "Disabling swap and ensuring it doesn't turn back on after reboot"
Expand Down

0 comments on commit 6f12f5d

Please sign in to comment.