Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Pocket-sized cloud with a Raspberry Pi (alexellis.io)
188 points by alexellisuk on March 23, 2022 | hide | past | favorite | 49 comments


In my homelab I've got RPis running Minio (S3-compatible block storage), step-ca (local certificate authority), CoreDNS (local DNS), a local gpsd/chrony setup (for local GPS-backed NTP, using the Uputronics GPS hat), shairport-sync (AirPlay server), and some web services fronted by Caddy. A great way to learn and try out various services, Linux distros, infrastructure management options, etc.


You ticked so many of my proverbial boxes with this and now I'm crossing my fingers you've written about any of it somewhere for public consumption!


I've written about the CA for Smallstep: https://smallstep.com/blog/build-a-tiny-ca-with-raspberry-pi...

I'd LOVE to write more about my homelab, but it's a work in progress that continues to evolve, and I haven't documented things as well as I'd like to!


Seconded. I just finally was able to snag two RPi 4s and they arrive today and I'm planning on going a similar route as the GP.


I've been thinking of re-casting Piku (https://github.com/piku) as a set of Caddy configs and little more, but haven't had the time to bunch together all the necessary plugins - but Caddy is a great base for building anything web-related.


how would you get started learning these things? I've always wanted to do something like this but I don't know what begin with


Pick a project (or better yet, a problem), and make it happen. Pick an area and tinker in it.

There's not really much more to it than that.

You may need to learn a ton as you go if you don't know the basics of the area the project is in. Software based projects are probably easier than hardware based projects in the sense that you won't lose money to change your mind.

On a RPi, you can always just rewrite the SD card and carry on. No harm, no foul. You're not counting on it like you would your main machine (until you are).


> Minio (S3-compatible block storage)

What are you using for storage? Powered HDD over USB or something?


Yep, a SATA SSD that runs over USB 3.0 is very fast on the RPi4, as long as you make sure "UASP mode" is enabled (this can take bit of tinkering). You don't even need external power, just a $5 USB to SATA cable.


Anecdata: I’ve found USB powered external drives to be unreliable on the Pi, even when powering the Pi with an official power adapter. I’d recommend using an external drive that comes with its own power adapter.


Counter anecdata: I've got a Ceph cluster running on multiple RPi 4s using external Seagate 4 and 5 TB portable hard drives. So far zero issues for about 1 year since I bootstrapped this cluster..

I use a combination of official RPi 4 power supplies and an Anker 6-port USB power block that I'm pretty sure tops out at less than 3 amps.

More importantly, everything is plugged into APC UPSes.


What is the UASP mode for?


Generally much faster than the traditional protocol[1].

However some USB SATA IC's have issued with it on Raspnberry Pi[2], requiring one to disable UASP. I have some JMicron-based USB-SATA adapters which falls into this category.

[1]: https://www.jeffgeerling.com/blog/2020/uasp-makes-raspberry-...

[2]: https://forums.raspberrypi.com/viewtopic.php?t=245931


How do you like the Uputronics GPS hat? I have the Adafruit Ultimate GPS on another Pi but have been casting around for another GPS system/chip to play with for NTP.


It's been great. Very reliable on the hardware side, I've never had any issues with it, but it did take a while for me to get it set up properly.


Awesome, I think I'll get one then. Would love to see your NTP writeup whenever you post it.

FWIW, I did see this but it's $$ : https://store.uputronics.com/index.php?route=product/product...


this is all on my homelab to-tinker list - any further comments you can share? assuming with a CA, DNS and NTP everything stays up without missing a beat if you lose WAN for some time?


The CA and NTP server would hum along just fine.

The DNS servers, less so: CoreDNS is reading my internal DNS zone from an Amazon Route53 private zone. This was my way of dealing with running two DNS servers concurrently, but it wouldn't do well in a WAN outage.

And, once I lose internal DNS, I lose everything else too

I've written about the CA for Smallstep: https://smallstep.com/blog/build-a-tiny-ca-with-raspberry-pi...

I wrote a piece about the NTP server, but I haven't had a chance to post it yet. There are some good resources out there for creating a local NTP server, though. It takes some time and effort to get everything dialed in, because GPS and NTP are both finicky and easy to misconfigure.

I'd LOVE to write more about my homelab, but it's a work in progress that continues to evolve, and I haven't documented things as well as I'd like to!


>TCO: ~35 USD

This is a nitpick, but I suspect the author doesn't know what "TCO" means. It doesn't mean "all in purchase price", it means... "total cost of ownership"[1]. The base raspberry pi[2] already costs between $25-$35. Add in shipping, cost of cables/charge/case (pictured), the purchase price alone would likely exceed $35. If we add in the cost of 5 years of power (I'm using 1W) that would definitely push us well beyond $35. And this is all before going over the biggest line item: cost of labor. It might be "free" to you, but if you're doing a cost calculation you should at least value it at the federal minimum wage.

[1] https://en.wikipedia.org/wiki/Total_cost_of_ownership

[2] https://en.wikipedia.org/wiki/Raspberry_Pi


Beyond that: Good luck finding the Pi 4 at MSRP right now. Agree with you 100%, however.


Other things that you can do (to build upon these) is to go for higher-level functions:

- Run n8n.io for inter-SaaS workflows

- Run Node-RED for lower-level automation

- Forego containers and use https://github.com/piku to run simple web apps

(disclaimer: I wrote Piku as a sort of anti-pattern since I wanted Heroku-style deploys without Docker and buildpacks)


love Piku! <3


For some reason I ended up in a discussion with a friend about this; the agreement was that this wasn't a cloud simply because it's a single point of failure and it's not "someone else's computer".

Which of course led to a discussion of whether you could, in principle, make self-contained cloud devices, powered by Radioisotope Thermoelectric Generators, which you could deploy to a) confuse and frighten but b) create a self-managing mesh cloud?


"Cloud" has become such a buzzword. The original pitch of cloud service computing was decentralized distribution as a means of service downtime mitigation and redundancy. Here we have someone who dumped a handful of services on an SBC providing a single point of failure which is the complete and total opposite of what a cloud is.

Rant aside, it's pretty great we can plop what was once needed a whole server rack onto a credit card sized device and call it a day but the "cloud" this is not.


We often joke that ``the cloud is just someone else' computer,'' but that's not entirely accurate, because it's not just one computer, it's a network of computers, allowing the processes on it to continue running regardless of the status of any individual piece of hardware, or any single OS.

To throw everything on a single Raspberry Pi isn't really a cloud, even though it's offering cloud-like services.


Came here to read this, luckily.

OP says: > "cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction." > "When I read this definition, it seems like the authors are describing a managed cloud provider like AWS, GCP or some installable software like Kubernetes or one of the major hypervisors."

When I read this, I think of my good old webhosting provider. Giving me access to webservers with resources, and fully automated without any hassle. And when there is trouble, I can actually speak to a human being.


Good luck finding any Pi. Pis are selling for $150 a piece where I live. This price is fixed. Whether you get a 2GB or 4GB version at this price is your bargain hunt. Big shops have none. It's now all in online personal ad market.


If you are extremely lucky to have a retailer nearby that sells them you can get one for MSRP. Microcenter has a one-per-ID policy on this sort of stuff when they are in stock if you are one of the few to have one in driving distance.


Serious question. I'm in my mid 40s, I've been using Linux for over two decades. I use a tinc network (also Syncthing) to manage my home and two offices, plus my kids laptops. We do gaming, I do media server stuff. I teach IT, I own a (presently inactive) web-design company..etc. etc.

All to say, I don't understand the point of this. What is this for and why would I want it?


It seems like the point is to introduce OpenFaaS.


Where are people buying Raspberry Pis these days? I went to go buy one a couple of days ago and it was sold out many places.


Best option is to set an email notification at the official resellers and immediately purchase when notified. For the time being, you won’t have more than 15 minutes to complete your purchase.

If you are US-based, you’ll want to create accounts at the sellers and verify them ahead of time, as vendors are implementing measures to prevent fraud and bots. Adafruit also requires your account to have 2FA active.


This page [0] keeps an updated list of RPi stock. Maybe it could help you find something when it restocks.

[0]: https://rpilocator.com/


Only tracks a small number of sites, however.


Seriously - would love to find one online, event for a tough markup. Not sure when to expect a new wave to become available on the market.


There are reports of graphics card and sneaker scalpers turning their bots to the RPi https://www.tomshardware.com/uk/news/raspberry-pi-4-supply-i...

So don't hold your breath


Adafruit just began requiring 2FA for purchases for just this reason.


I am totally lost as to how this is a cloud.

The author's definition of pocket-sized cloud is "a place to run our code, which can be configured through an API - using containers for packaging" and that is not what I understand a cloud to be.

It doesn't seem to have any of the definitive properties of cloud computing. What am I missing here?


I wonder if it would be possible to setup dummy billing. That would be fun.


> Many of us own at least one Raspberry Pi, and if it's not doing duty as a media player, retro gaming console, blocking ads, or reporting the weather, then it may well be gathering dust.

> I'm writing this article as an excuse for you to blow the dust off those microchips, and to put your pocket-sized silicon to work as the world's smallest API-driven cloud.

> By following the instructions in this article, you'll be able to deploy scheduled tasks, webhook receivers, web pages and functions to your pocket-sized cloud from anywhere using a REST API.


Read this two times, but really couldn't understand why I'd want to do this, which practical problems this is going to solve. Must be getting old...


Isn't that the case for a lot of things you learn? Sometimes it's just nice to get exposed to new things or concepts even if you never use any of it in practice.


Wouldn't it be a better use of your time to up-skill in something that can enhance your personal or professional life?

Sure, one can learn about OpenFaaS with this project, but is there truly a market demand for it? And how does it benefit the learner?


What is best for you to learn is not a question I can answer. That depends on your goals and your knowledge and I don't know what they are.


This reminded me of: "we live in such a time of plenty with respect to things we can learn that it is important to make conscious choices about what not to learn".


That's a great quote, where did it come from?


My apologies. I now see that it might look like a quote. I was trying to capture the sense of an HN submission (or perhaps it was some posts - I can't seem to find it now) from a few days ago that was discussing the abundance of opportunity we have these days for learning pretty much anything we might be interested in. Years ago I would make weekly trips to the local university to read journals and drop a dime per page to copy articles of interest on the library's photocopier. The internet existed but was limited to universities etc.


Well, the quote is attributed to you!

I've been seeing this more and more as people and whole organizations feel compelled to learn everything that comes their way.


It's tech FOMO!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: