Get the highlights in your inbox every week.
5 reasons to run Kubernetes on your Raspberry Pi homelab | Opensource.com
5 reasons to run Kubernetes on your Raspberry Pi homelab
A new free eBook offers step-by-step instructions for creating a private cloud at home, including what you can do with it when you're done.
There's a saying about the cloud, and it goes something like this: The cloud is just somebody else's computer. While the cloud is actually more complex than that (it's a lot of computers), there's a lot of truth to the sentiment. When you move to the cloud, you're moving data and services and computing power to an entity you don't own or fully control. On the one hand, this frees you from having to perform administrative tasks you don't want to do, but, on the other hand, it could mean you no longer control your own computer.
This is why the open source world likes to talk about an open hybrid cloud, a model that allows you to choose your own infrastructure, select your own OS, and orchestrate your workloads as you see fit. However, if you don't happen to have an open hybrid cloud available to you, you can create your own—either to help you learn how the cloud works or to serve your local network.
Building your own cloud requires at least three Raspberry Pi units, an Arm Linux distribution to serve as an OS, and Kubernetes to help you manage the containers your cloud will run. Chris Collins explains every step you need to take to make this happen in our new eBook. If you've ever built an array of distributed computing nodes, you'll probably be surprised at how simple it is. Sooner than you expect, you'll reach the end of the installation, and you'll inevitably be faced with this question:
What's the real-world application of a private cloud running on tiny computers in your office? What do you need Kubernetes for, anyway? I used to ask myself the same questions, and I've come up with enough answers to justify a minor investment in a spare Raspberry Pi or two and the time it takes to follow the instructions in Chris' eBook. Here are some ideas for you.
Network-attached storage for your home
If you're a hobbyist just looking to try out the latest tech, one of the easiest entry points is improving your network. Since the Raspberry Pi was released, I've never been without a home server—even during the times my home was just a rented room in the suburbs. My home networks weren't always very complicated, but they ran a few services that I enjoyed having available, so it suited me.
By following along with Chris' eBook, I've recently added Kubernetes and a few nodes to my network, which give me the ability to add any number of services. I've finally got Network Filesystem (NFS) running, so my partner and I have an easy backup plan and can access shared files as if they existed locally on any computer we're using. I'm also running the open source Kodi media server, so we can watch movies, listen to music, and view photos (all stored on the NFS share) anywhere in the house. A Nextcloud installation makes collaboration easy, and it also helps us keep in touch with family members in other countries without resorting to the likes of Facebook.In short, Kubernetes and the many container images available for easy installs have transformed my local network into my own personal internet or supercomputer. It doesn't provide all services for all people, but it provides exactly the services I want for the people who I want to have access.
If you're duplicating media or applications across several devices or building a home server, you should consider a Kubernetes cluster. It's easy to scale for power and storage, it's easy to maintain, and it's a lot of fun.
Education and upskilling
Are you considering a career in IT? Are you already in IT but want to grow as a professional? The cloud is a powerful model, and Kubernetes is an easy way to wrangle a lot of potential power. The more you learn about these concepts, the better prepared you'll be to move up in your career.
One of the most frustrating aspects of the cloud in its early days was its inaccessibility. If you didn't own racks of servers, it was difficult to gain experience administering and maintaining a cloud infrastructure. Thanks to open source projects like Kubernetes, OKD, LXC, and Podman, building your own cloud has become possible. Thanks to the Raspberry Pi and other Arm-based system-on-a-chip (SoC) computers, it's also affordable.
The internet is one of the most accessible entry points into modern technology. Since the '90s, regular folk have wandered into the strange world of computing by reading HTML in a desperate attempt to understand how to put an animated GIF onto a Myspace or Geocities page. A natural progression from rudimentary HTML and CSS is to run a web server. Admittedly, a Kubernetes cluster probably is overkill for a personal site, but it's a great project to become familiar with how Kubernetes pods work and why they're important. It's also a great way to learn about routing and load balancing.
Linux containers have changed IT and computing as a whole. The original LXC toolset enabled and inspired hugely popular technologies like Docker, Flatpak, Kubernetes, Podman, and more. Containerization is a new model of running code that's showing up on operating systems for desktops and mobile devices.
The problem is, containers are different from what most users are accustomed to. Traditionally, binaries were compiled according to the operating systems, they were linked to locally available libraries, and they generally had access to everything on the hard drive. Containers are different. They're miniature runtime environments with binaries run within them, linked to other libraries in the container, and it's all kept separate from the host system unless it's granted a specific exemption. Furthermore, a container is ephemeral. You can create a container and dispose of it arbitrarily. Running a service in a container is a great way to learn how data can be persistent in an environment designed to end and respawn at any moment.
As painful as that learning curve can be, discovering how easy containerized apps are to install opens a whole new world of possibilities. You can run the Grafana dashboard, the Prometheus monitoring software, Discourse, Nextcloud, and a dozen others from prebuilt container definitions or Helm charts.
If you're a developer delivering apps for the web, Kubernetes offers many benefits. It can transform your workflow, and most importantly, it can help make your apps resilient. When you're developing for the cloud, you leverage the best principles of microservices in the context of containers, and you're able to use the advantages of distributed computing, filesystems, and databases.
Try Kubernetes yourself
If you've learned the basics of Kubernetes, now's the time to take your knowledge a step further with your very own private cloud. Download our free eBook and start using Kubernetes today. You never know where it will take you.