Skip to content

Commit

Permalink
docs: add notes on running Sidero on RPi4
Browse files Browse the repository at this point in the history
This is mostly a tutorial, as it doesn't contain any unique content, but
stitches together many guides to show easy walkthrough.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira authored and talos-bot committed Jun 3, 2021
1 parent 864ec57 commit dfeaeec
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 4 deletions.
7 changes: 3 additions & 4 deletions website/content/docs/v0.3/Guides/rpi4-as-servers.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Using Raspberrypi pi 4 as servers"
description: "Using Raspberrypi Pi 4 as servers"
weight: 6
title: "Raspberry Pi4 as Servers"
---

# Raspberrypi4 as servers

This guide will explain on how to use Sidero to manage Raspberrypi-4's as
servers.
This guide goes hand in hand with the [bootstrapping
Expand All @@ -16,7 +15,7 @@ Once you finish with this guide, you will need to go back to the
bootstrapping guide and continue with "Register the servers".

The rest of this guide goes with the assumption that you've a cluster setup with
sidero and ready to accept servers.
Sidero and ready to accept servers.
This guide will explain the changes that needs to be made to be able to accept RPI4 as server.

## RPI4 boot process
Expand Down
158 changes: 158 additions & 0 deletions website/content/docs/v0.3/Guides/sidero-on-rpi4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
description: "Running Sidero on Raspberry Pi 4 to provision bare-metal servers."
title: Sidero on Raspberry Pi 4
weight: 7
---

Sidero doesn't require a lot of computing resources, so SBCs are a perfect fit to run
the Sidero management cluster.
In this guide, we are going to install Talos on Raspberry Pi4, deploy Sidero and other CAPI components.

## Prerequisites

Please see Talos documentation for additional information on [installing Talos on Raspberry Pi4](https://www.talos.dev/docs/v0.10/single-board-computers/rpi_4/).

Download the `clusterctl` CLI from [CAPI releases](https://github.com/kubernetes-sigs/cluster-api/releases).
The minimum required version is 0.3.17.

## Installing Talos

Prepare the SD card with the Talos RPi4 image, and boot the RPi4.
Talos should drop into maintenance mode printing the acquired IP address.
Record the IP address as the environment variable `SIDERO_ENDPOINT`:

```bash
export SIDERO_ENDPOINT=192.168.x.x
```

> Note: it makes sense to transform DHCP lease for RPi4 into a static reservation so that RPi4 always has the same IP address.
Generate Talos machine configuration for a single-node cluster:

```bash
talosctl gen config --config-patch='[{"op": "add", "path": "/cluster/allowSchedulingOnMasters", "value": true},{"op": "replace", "path": "/machine/install/disk", "value": "/dev/mmcblk0"}]' rpi4-sidero https://${SIDERO_ENDPOINT}:6443/
```

Submit the generated configuration to Talos:

```bash
talosctl apply-config --insecure -n ${SIDERO_ENDPOINT} -f controlplane.yml
```

Merge client configuration `talosconfig` into default `~/.talos/config` location:

```bash
talosctl config merge talosconfig
```

Update default endpoint and nodes:

```bash
talosctl config endpoints ${SIDERO_ENDPOINT}
talosctl config nodes ${SIDERO_ENDPOINT}
```

You can verify that Talos has booted by running:

```bash
$ talosctl version
talosctl version
Client:
Tag: v0.10.3
SHA: 21018f28
Built:
Go version: go1.16.3
OS/Arch: linux/amd64

Server:
NODE: 192.168.0.31
Tag: v0.10.3
SHA: 8f90c6a8
Built:
Go version: go1.16.3
OS/Arch: linux/arm64
```

Bootstrap the etcd cluster:

```bash
talosctl bootstrap
```

At this point, Kubernetes is bootstrapping, and it should be available once all the images are fetched.

Fetch the `kubeconfig` from the cluster with:

```bash
talosctl kubeconfig
```

You can watch the bootstrap progress by running:

```bash
talosctl dmesg -f
```

Once Talos prints `[talos] boot sequence: done`, Kubernetes should be up:

```bash
kubectl get nodes
```

## Installing Sidero

Install Sidero with host network mode, exposing the endpoints on the node's address:

```bash
SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=${SIDERO_IP} clusterctl init -i sidero -b talos -c talos
```

Watch the progress of installation with:

```bash
watch -n 2 kubectl get pods -A
```

Once images are downloaded, all pods should be in running state:

```bash
$ kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
cabpt-system cabpt-controller-manager-6458494888-d7lnm 1/1 Running 0 29m
cacppt-system cacppt-controller-manager-f98854db8-qgkf9 1/1 Running 0 29m
capi-system capi-controller-manager-58f797cb65-8dwpz 2/2 Running 0 30m
capi-webhook-system cabpt-controller-manager-85fd964c9c-ldzb6 1/1 Running 0 29m
capi-webhook-system cacppt-controller-manager-75c479b7f-5hw89 1/1 Running 0 29m
capi-webhook-system capi-controller-manager-7d596cc4cb-kjrfk 2/2 Running 0 30m
capi-webhook-system caps-controller-manager-79664cf677-zqbvw 1/1 Running 0 29m
cert-manager cert-manager-86cb5dcfdd-v86wr 1/1 Running 0 31m
cert-manager cert-manager-cainjector-84cf775b89-swk25 1/1 Running 0 31m
cert-manager cert-manager-webhook-7f9f4f8dcb-29xm4 1/1 Running 0 31m
kube-system coredns-fcc4c97fb-wkxkg 1/1 Running 0 35m
kube-system coredns-fcc4c97fb-xzqzj 1/1 Running 0 35m
kube-system kube-apiserver-talos-192-168-0-31 1/1 Running 0 33m
kube-system kube-controller-manager-talos-192-168-0-31 1/1 Running 0 33m
kube-system kube-flannel-qmlw6 1/1 Running 0 34m
kube-system kube-proxy-j24hg 1/1 Running 0 34m
kube-system kube-scheduler-talos-192-168-0-31 1/1 Running 0 33m
```

Verify Sidero installation and network setup with:

```bash
$ curl -I http://${SIDERO_ENDPOINT}:8081/tftp/ipxe.efi
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 1020416
Content-Type: application/octet-stream
Last-Modified: Thu, 03 Jun 2021 15:40:58 GMT
Date: Thu, 03 Jun 2021 15:41:51 GMT
```

Now Sidero is installed, and it is ready to be used.
Configure your DHCP server to PXE boot your bare metal servers from `$SIDERO_ENDPOINT` (see [Bootstrapping guide](../bootstrapping/) on DHCP configuration).

## Backup and Recovery

SD cards are not very reliable, so make sure you are taking regular [etcd backups](https://www.talos.dev/docs/v0.10/guides/disaster-recovery/),
so that you can [recover](https://www.talos.dev/docs/v0.10/guides/disaster-recovery/) your Sidero installation in case of data loss.

0 comments on commit dfeaeec

Please sign in to comment.