Cloud native homelab, Part 1: Hardware
Tags: raspberrypi, orangepi, homelab, kubernetes
Published: 2023-09-10 03:29:43

---
series: Build a cloud native homelab
---

In this first installment of the series on building a cloud native homelab, we go over selecting your hardware. 

The emphasis here is on cost optimization so we're **not** getting a [cluster board](https://turingpi.com/product/turing-pi-2/), a bunch of compute modules ([general purpose](https://www.raspberrypi.com/products/compute-module-4/?variant=raspberry-pi-cm4001000) or [machine learning](https://store.nvidia.com/en-us/jetson/store/?page=1&limit=9)), servers, a rack mount, or anything like that. We'll start out with one or two single-board computers (SBCs) that we can set up easily without a big capital expense. This will allow us to:
* Deploy new nodes to our homelab in an automated fashion, just like on a public cloud with [cloud-init](https://cloud-init.io).
* Set up a [Kubernetes](https://kubernetes.io) cluster and deploy workloads to it using cloud native technologies for container orchestration, storage, and more.
* Interact with the real world through sensors, cameras, motors, and other hardware if we choose to.

The most popular SBC is Raspberry Pi but finding one during a shortage may be hard. Fortunately at the time of this writing the shortage is over and you can now easily find one at a reasonable price. There are cheaper options, though, and you might be tempted to buy something like the Orange Pi. Let's go over the differences to show exactly what you're getting with each.

*TL;DR Get the Raspberry Pi if you want a cloud native homelab*

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1mer6vmt81awg37l856.png)

<table>

<tr>
<th></th>
<th>Raspberry Pi 4B</th>
<th>Orange Pi 3B</th>
</tr>

<tr>
<td>Origin</td>
<td>United Kingdom</td>
<td>China</td>
</tr>

<tr>
<td>RAM</td>
<td>8GB LPDDR4-3200 SDRAM</td>
<td>8GB LPDDR4/4x</td>
</tr>

<tr>
<td>Storage</td>
<td>Micro-SD card slot</td>
<td>Micro SD slot.<br> 
Supports an eMMC module: 16GB - 256GB.<br> 
SPI Flash: 16MB/32MB.<br> 
M.2 M-KEY slot for SATA3 or PCIe 2.0 NVMe SSD.</td>
</tr>

<tr>
<td>Price (USD)</td>
<td>$75 + shipping</td>
<td>$45 + shipping</td>
</tr>

<tr>
<td>OS</td>
<td>Raspberry Pi OS, Ubuntu, RetroPie, Recalbox, OctoPi, Home Assistant, others</td>
<td>Orange Pi OS [1], Ubuntu, Debian, Android, others</td>
</tr>

<tr>
<td>Official images from Ubuntu and Debian?</td>
<td>Yes</td>
<td>No. Custom Ubuntu and Debian images provided by Orange Pi.</td>
</tr>

<tr>
<td>cloud-init included?</td>
<td>Yes (at least on Ubuntu)</td>
<td>No</td>
</tr>

<tr>
<td>Default Ubuntu package repo</td>
<td>ubuntu.com</td>
<td>huaweicloud.com</td>
</tr>

<tr>
<td>Linux kernel release [4]</td>
<td>5.15.0-1037-raspi (kernel extra modules available)</td>
<td>5.10.160-rockchip-rk356x (kernel extra modules not available)</td>
</tr>

<tr>
<td>CPU</td>
<td>Broadcom BCM2711 Quad core Cortex-A72 (ARM v8) 64-bit SoC 1.8GHz</td>
<td>Rockchip RK3566 Quad-core Cortex-A55 (ARM v8) 64-bit SoC 1.8GHz</td>
</tr>

<tr>
<td>Graphics Processing Unit (GPU)</td>
<td>Integrated</td>
<td>ARM Mali G52 2EE (Bitfrost) [2]</td>
</tr>

<tr>
<td>Neural Processing Unit (NPU)</td>
<td>-</td>
<td>Rockchip NPU AI accelerator with 0.8Tops@INT8 performance.<br> 
RKNN model type supports conversion of Caffe / TensorFlow / TFLite / ONNX / PyTorch / Keras / Darknet models</td>
</tr>


<tr>
<td>Vision Processing Unit (VPU)</td>
<td>-</td>
<td>Yes</td>
</tr>

<tr>
<td>Graphics & Video</td>
<td>OpenGL ES 3.1, Vulkan 1.0.<br> 
H.265 (4K 60fps decode).<br> 
H.264 (1080p 60fps decode, 1080p 30fps encode).</td>
<td>GPU<br>
OpenGL ES 3.2/2.0/1.1, Vulkan 1.1, OpenCL 2.0.<br> 
Embedded high performance 2D acceleration hardware.<br><br>
VPU<br>
H.265/H.264/VP9 (4K 60fps decode).<br> 
H.265 (1080p 100fps encode).<br> 
H.264 (1080p 60fps encode).
</td>
</tr>

<tr>
<td>Ethernet</td>
<td>Gigabit</td>
<td>Gigabit</td>
</tr>

<tr>
<td>Wireless</td>
<td>Wi-Fi 5 (802.11ac)<br> 
Bluetooth 5.0, BLE</td>
<td>Wi-Fi 5 (802.11ac)<br> 
Bluetooth 5.0, BLE<br>
Wired antenna (not shown). Useful when building into a metal housing.</td>
</tr>

<tr>
<td>USB</td>
<td>2 USB 3.0 ports<br> 
2 USB 2.0 ports</td>
<td>1 USB 3.0 HOST<br> 
2 USB 2.0 HOST<br> 
1 USB 2.0 Device or HOST mode</td>
</tr>

<tr>
<td>General Purpose Input/Output (GPIO)</td>
<td>40 pin GPIO header</td>
<td>40 pin header supporting interface types: GPIO, UART, I2C, SPI, PWM</td>
</tr>

<tr>
<td>Video output</td>
<td>2 × micro-HDMI up to 4K 60fps.<br> 
1 × 2-lane MIPI DSI display port.</td>
<td>1 × HDMI TX 2.0 up to 4K 60fps.<br> 
1 × 2-lane MIPI DSI display port.<br>
eDP1.3</td>
</tr>

<tr>
<td>Camera</td>
<td>1 × 2-lane MIPI CSI camera port</td>
<td>1 × 2-lane MIPI CSI camera port</td>
</tr>

<tr>
<td>Audio</td>
<td>4-pole stereo audio and composite video port</td>
<td>3.5mm headphone jack audio in/out</td>
</tr>

<tr>
<td>Power</td>
<td>5V DC via USB-C (minimum 3A) [3].<br>
5V DC via GPIO header (minimum 3A) [3]<br> 
Power over Ethernet (PoE) enabled (requires separate PoE HAT).</td>
<td>5V DC via USB-C (3A)</td>
</tr>

<tr>
<td>Button</td>
<td>-</td>
<td>1 MaskROM key<br> 
1 RESET key<br> 
1 POWER key</td>
</tr>

<tr>
<td>Fan</td>
<td>Use the GPIO pins (3.3V or 5V) 2.54mm pin pitch</td>
<td>2-Pin 1.25mm pin pitch 5V fan connector</td>
</tr>

<tr>
<td>Real-time clock (RTC)</td>
<td>Use the GPIO pins (3.3V) 2.54mm pin pitch</td>
<td>2-Pin 1.25mm pin pitch battery backup connector</td>
</tr>

<tr>
<td>Dimensions</td>
<td>85mm x 56mm x 11mm<br> 
46g</td>
<td>85mm x 56mm x 17mm<br> 
49g</td>
</tr>

</table>
###### [1] Orange Pi OS doesn't support the GPU, NPU, or VPU. But Debian, Ubuntu, and Android support them.
###### [2] [arm.com](https://developer.arm.com/Processors/Mali-G52), [Rockchip GitHub](https://github.com/rockchip-linux/rknpu2)
###### [3] A good quality 2.5A power supply can be used if downstream USB peripherals consume less than 500mA in total.
###### [4] Linux kernel extra modules `nvme_fabrics` and `nvme_tcp` are required for cloud native storage like OpenEBS.

* You'll also need a 5V 3A power supply for each board if you're not setting them up with Power over Ethernet (PoE). 
* You *don't* need a mouse and keyboard for the boards because you'll manage them over [SSH](https://www.ssh.com/academy/ssh) from your laptop. Even if you installed a graphical desktop, you could still access it remotely with a VNC viewer.
* If you're not setting them up with Wi-Fi, you'll need an ethernet cable (CAT 5e or better) for each board.
* For many applications you can use the Pi by itself without heat sinks or a fan and monitor the temperature in millidegree Celsius with `cat /sys/class/thermal/thermal_zone*/temp`. But we're going to be running some resource-intensive software like Kubernetes. For our cloud native homelab I recommend getting heat sinks, a fan, and a case to house everything from the start. The [Raspberry Pi ARM cores and GPU will start throttling](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#frequency-management-and-thermal-control) when they reach around 80°C.
* Speaking of cases, I recommend getting a cluster case. It's way cheaper than a cluster board and it houses your Pis in a stackable way so it's great for expanding your homelab in the future. [This one](https://thepihut.com/products/cluster-case-for-raspberry-pi) from the UK is particularly nice and made with Perspex (a high-quality acrylic) but there are other options on Amazon with faster shipping.
* For storing large amounts of data you'll need external storage like an SSD drive. I recommend a SATA SSD although if you already have an NVMe SSD you can use that as well, just know that your board won't take full advantage of its speeds. [This one](https://thepihut.com/products/wd-green-240gb-2-5-ssd) is a great option along with [this cable](https://thepihut.com/products/ssd-to-usb-3-0-cable-for-raspberry-pi). Just make sure the cable/adapter has an ASMedia chipset.

With Raspberry Pi it's easy to automate the setup with cloud-init. You're also able to have cloud native replicated storage with OpenEBS thanks to the extra kernel modules for NVMe over Fabrics. If you want your homelab to be cloud native, Raspberry Pi is the way to go.

For Orange Pi, cloud-init is not included. On top of that, the images provided by Orange Pi can't be mounted on macOS so you can't inject the `user-data` anyway (and you have to use the images they provide, others won't work). That means you'll have to set it up manually. There's also the issue of not being able to use cloud native storage due to a lack of extra modules for that kernel release. Having said that, Orange Pi's AI capabilities might be a good addition to your homelab if you need a low-cost AI-accelerated IoT device and don't need any cloud native features like an automated setup or replicated storage.

If you have a 32-bit SBC like the Raspberry Pi 2, keep in mind that it can't run some Kubernetes distributions like MicroK8s so whatever SBCs you choose make sure they're 64-bit. If you have a Pi 2 it's great as a dedicated retro gaming console with [Recalbox](https://www.recalbox.com).  

In the next part of this series, we'll set up our nodes as a Kubernetes cluster.