Q&A

Upcycle Your Old Laptops into a Kubernetes Cluster

How about a little project to repurpose your end-of-life Win 10 PC to power a cheap Kubernetes cluster to save money, learn about Windows-to-Linux conversions, and how to break and fix cloud containers -- all while helping to save the world from e-waste with some "sheer geeky fun?"

"If you are interested in Kubernetes, containers, and want an actual multi-node cluster you can use for learning, it is kind of fun to build your own by using low-cost devices such as old laptops (like soon to be 'obsolete' Windows 10 laptops), plus a few extra bits of hardware," says Rockford Lhotka, who dreamed up the project and is now sharing it with developers on the conference circuit.

The next stop on that circuit for Lhotka, VP of Strategy at Xebia, is a the big multi-conference Live! 360 event for developers and IT pros coming next month in Orlando. While Lhotka's session is part of the "Cloud & Containers" conference at the event, others are devoted to Visual Studio, AI, Cybersecurity & Ransomware and more.

In his 20-minute quick-hit introductory/intermediate session, titled, "Fast Focus: Upcycle Your Old Laptops into a Kubernetes Cluster," attendees are promised to learn:

  • About upscaling or repurposing old laptops to run Linux
  • About installing Kubernetes on a device
  • About using your personal Kubernetes cluster for .NET development

Here's a Q&A to learn more about the session.

VisualStudioMagazine: What inspired you to present a session on this topic?
Lhotka: My inspiration is twofold. One is the sheer geeky fun of building my own computing cluster for very little money. The other is to repurpose perfectly good, if "old" hardware rather than clogging up landfills with toxic waste.

Some years ago, working with Robert Sirchia, I built a Kubernetes cluster using Raspberry Pi devices. That was a fun learning experience, but I rapidly discovered that a lot of software can't run on ARM processors and requires the x64 architecture.

I started repurposing old laptops we had laying around the house gathering dust, and adding them as nodes to my cluster so I could run workloads on ARM and Intel processors.

"What makes this even more exciting today is that a lot of 'old' Windows 10 computers are about to become 'obsolete' because they can't upgrade to Windows 11."

Rockford Lhotka, VP of Strategy, Xebi

What makes this even more exciting today is that a lot of "old" Windows 10 computers are about to become "obsolete" because they can't upgrade to Windows 11. Rather than this becoming an ecological issue of disposing of perfectly good computers into landfills, we all have an opportunity to repurpose these "old" computers into nodes in Kubernetes clusters!

Inside the Session

What: Fast Focus: Upcycle Your Old Laptops into a Kubernetes Cluster

When: Nov. 19, 2024, 2 p.m. - 2:20 p.m.

Who: Rockford Lhotka, VP of Strategy, Xebi

Why: Learn how to assemble a multi-node cluster with Linux and Kubernetes all for less than the cost of a low-end laptop.

Find out more about Live 360! taking place Nov. 17-22 at Universal Orlando

What are the key hardware and software requirements for this project?
You need to have at least 2-3 old computers or Raspberry Pi devices, each with a minimum of 8 gigs of memory. A lot of us (or our families and friends) have old laptops or even desktops sitting around gathering dust that meet this requirement. It doesn't matter if the original operating system was Windows or MacOS or something else, because they'll become Linux machines during the process.

Next you need a network switch with a port for each of your devices, plus one for your home network. And short ethernet cables to connect between the switch and each of your devices.

Finally, you need a Linux server distro, like Ubuntu, Debian, or another of your choice. With Linux installed on each device, it is possible to download and install one of several Kubernetes distros such as k3s or microk8s to create your cluster.

How does the performance of a laptop-based Kubernetes cluster compare to other low-cost solutions?
This approach is extremely low cost. Mostly it is the cost of the ethernet switch and a few short cables, because the rest of the hardware can be repurposed computers you already have laying around. Nothing else will come close to meeting this cost point.

If you host Kubernetes in Azure or AWS, it will probably cost a couple hundred dollars per month to sit idle and more under load. This home-built cluster may cost $200-$500 total to set up with no real monthly fee beyond a little electricity.

Can the nodes in a cloud-based cluster outperform your aging laptop nodes? Certainly! Can they outperform enough to be worth the monthly cost compared to the near-zero cost of your personal cluster? This probably depends on what sort of work you are trying to do with the cluster.

What challenges did you face during the setup, and how did you overcome them?
The first challenge for me are that I'm not a Linux administrator by trade, and so the learning curve on how to install and configure Linux was a little steep.

The second challenge was similar, in that Kubernetes itself can be very complex. When I built my first cluster I had to do it all by hand, but these days we have access to pre-built Kubernetes packages like k3s and microk8s, so life is much simpler than it was in the past.

The final challenge, if you want to call it a challenge, is that I kept experimenting with different features and configurations, and frequently broke my cluster. Of course, this is the reason I wanted to build my own cluster: to learn. So this is less of a challenge, than an opportunity to get really good at rebuilding the cluster from scratch after making a mistake or two.

Can you explain the benefits of using a personal Kubernetes cluster for .NET development?
For most of us as individual developers, it is not cost effective to pay for a cloud-based cluster to learn and experiment with different Kubernetes configurations, or to build and deploy our .NET software as we learn how to build cloud-native solutions.

It is extremely cost effective to help the environment by repurposing old hardware to learn how to set up and configure a Kubernetes cluster, and then to learn how to build and deploy cloud-native .NET software in that cluster. The ongoing cost of running the cluster is negligible, and you have such a great opportunity to learn the whole stack and process from bottom to top.

How scalable is this solution for more complex projects or larger clusters?
My cluster has about 6 nodes, one of which is an old gaming laptop which is still quite a powerful machine. I'm able to run a couple database instances, numerous .NET containers, and some other pre-built containers like pihole without any problem.

When I think about a "complex" project, the first thing I think about is that there's probably a decent database involved, and you may need a node with more memory (perhaps 16 gigs) to get decent performance out of PostgreSQL or SQL Server.

Running your compute workloads, typically containers with your .NET software, really doesn't consume that much memory in most cases. The specific amounts of memory and CPU depend, of course, on exactly what you are trying to do.

In theory you can scale your cluster to a lot of nodes. Mine remains quite small and meets my needs. I suspect that things would get a lot more complex when running a cluster with dozens of nodes, each of which is an old computer nearing the end of its life. Even in my small cluster I've had a node failure.

Of course node failure is one of the things Kubernetes is designed to overcome, and so having an old computer die is part of the learning process and an opportunity to discover if you've configured your cluster and your cloud-native .NET project correctly.

Are there specific use cases or applications where this setup particularly excels?
For me, this is all about learning the Kubernetes and .NET cloud-native stack from top to bottom. As a learning and teaching tool it is fantastic.

I do laugh though, because my little home-built cluster is far, far more powerful than the refrigerator-sized "mini-computer" that ran all the software in my first couple jobs after I graduated from university.

So in reality, could you use a cluster like this to run a small or mid-sized business? Absolutely! Is that a good idea? I'm not so sure. Having downtime with my hobby cluster is inconvenient at worst, but having downtime that stops hundreds of employees from getting their jobs done is a whole other matter.

Personally, I think I'd rather use a cloud-based cluster that has a monthly fee if the result is better uptime and resiliency for my business.

What security considerations should be taken into account when using repurposed hardware for Kubernetes?
The first step in repurposing a computer to become a node in a Kubernetes cluster is to reformat the hard drive and install Linux. If people are donating their old computers to me, that's fine. If I'm donating my old computers to someone else, I'd want to ensure no private data is on the hard drives before the donation, because someone could maybe access that data before reformatting the drives.

Once your cluster is actually running, by default it will be running privately within your home network. You have to take steps to make it accessible from outside your network. That comes with the same risk as opening any ports from the Internet into your personal network and must be done with care.

Security is one of the most important, and sadly complex, aspects of Kubernetes configuration. The public cloud Kubernetes offerings generally default to secure configurations, but when building your own cluster it is up to you to learn about and implement the right policies.

Note: Those wishing to attend the conference can save hundreds of dollars by registering early, according to the event's pricing page. "Save $300 when you register by the Early Bird deadline of Oct. 25!" said the organizer of the event, which is presented by the parent company of Visual Studio Magazine.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube