Live data from Hacker News

Converting an old MacBook into an always-on personal Kubernetes cluster

devopsdirective.com

61–70 of 126 posts

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#62
post #45

For what it's worth, I built one like this on an old Linux laptop. I then moved my home lighting controller onto it as a test. Some months later my house lights stopped working, and I had to spend a few hours applying snippets semi-randomly from Stack Overflow. It could be the problem was due to expired Kubernetes certificates, or it could be something else. Either way, my conclusion was that Kubernetes is really mea…

FYI, if you're looking to deploy a hobbyist/side-project Kubernetes cluster I'd highly recommend k3s [1] - it's a lightweight certified distribution, and is ridiculously easy to set up. I haven't needed to do any maintenance besides the periodic update.

It also works fine for production in my experience, I have a mildly popular website running on a 4GB VPS with it and haven't had any issues related to k3s itself.

[1]: https://k3s.io/

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#63
post #59
post #45

For what it's worth, I built one like this on an old Linux laptop. I then moved my home lighting controller onto it as a test. Some months later my house lights stopped working, and I had to spend a few hours applying snippets semi-randomly from Stack Overflow. It could be the problem was due to expired Kubernetes certificates, or it could be something else. Either way, my conclusion was that Kubernetes is really mea…

I have a strong feeling that the added complexity of Kubernetes does not give most use cases a net payoff for hobbyists. A lot of the quirks and monkey wrenching with both Docker and Kubernetes seems to be like problems that in many cases were solved in traditional _NIX systems decades ago. I'm sure there are benefits of throwing some of that architecture out for some scenarios but people shouldn't treat it as a new…

Docker's been great for hobbyist stuff for me. But I don't really use anything fancy on it, just map some folders for storage I want to survive rebuilds[1] and forward necessary ports to the host machine's interfaces. I don't rely on swarm or any of that. I mostly use it to avoid having to worry about distro-specific crap, since I no longer care to (re-)learn any of that. I don't even use docker-compose since almost none of my personal services depend on one another, just simple shell scripts that all look pretty similar.

[1] In some ways this is easier than running traditional daemons, as storage locations for dockerized services tend to be well-documented, prominently, all in one place, and don't change from, say, one package manager to another. You can very easily get all your dockerized services storing their important stuff under one isolated tree, and back up the whole thing. That plus your run scripts are all you need to restore, no matter which host platform you use.

[EDIT] in fact, getting Samba set up for my super simple and surely common use case of "I want these folders shared read-only for everyone, and these others writable for this one user" was much easier with Docker than it's been since back when I used Gentoo. The fancier distros all seem to make it a big pain in the ass to do anything other than sharing user directories through the GUI, and change Samba configs between seemingly every major release, and they're always a mess. With the Dockerized version it was one short and sweet arcane magical line per directory I wanted to share, so no clearer, but very short and worked on the first try.

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#64

Earlier quoted context omitted.

Your Kubernetes node itself is Linux, so requires virtualization if your host machine is not Linux. Docker for Mac also works this way; when you run a container, it's running on a Linux VM that Docker sets up, not on your Mac directly. Even on Linux, minikube uses a separate VM. It's just cleaner than having the kubelet running on your workstation directly. (microk8s takes a different approach and runs on your machin…

> Your Kubernetes node itself is Linux, so requires virtualization if your host machine is not Linux. Thus my question: If the aim is to use the machine for a Kubernetes "cluster", why not boot proper Linux on it, so Kubernetes can run at full speed, without any VM overhead?

Agreed

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#65
post #48

You could sell the MacBook and build a decent raspberrypi cluster with the money you make on it.

except it may not easily survive a power outage

I believe running a MacBook as an always on server will pretty rapidly destroy the battery anyway.

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#66
post #62
post #45

For what it's worth, I built one like this on an old Linux laptop. I then moved my home lighting controller onto it as a test. Some months later my house lights stopped working, and I had to spend a few hours applying snippets semi-randomly from Stack Overflow. It could be the problem was due to expired Kubernetes certificates, or it could be something else. Either way, my conclusion was that Kubernetes is really mea…

FYI, if you're looking to deploy a hobbyist/side-project Kubernetes cluster I'd highly recommend k3s [1] - it's a lightweight certified distribution, and is ridiculously easy to set up. I haven't needed to do any maintenance besides the periodic update. It also works fine for production in my experience, I have a mildly popular website running on a 4GB VPS with it and haven't had any issues related to k3s itself. [1]…

Amen to that, after avoiding kubernetes at home for so long (run a quite a lot of clusters at work in production and while not a nightmare, it is a lot of work) - I've now moved most of my self-hosted stuff to k3s. It's been a joy to work with.

We're even looking at starting to migrate most of our edge deployments to k3s as well.

Really really awesome piece of work by Rancher.

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#68

Earlier quoted context omitted.

A big problem is local storage provisioner for kubernetes is still not GA. I want to use an SSD attached to one master, and use that as storage for the other RPIs. Doing this is still undocumented/the Wild West.

Disclaimer: k8s beginner here. As far as I understand, local storage provisioner is for the node local storage; the storage doesn't follow the workload to whatever node is the pod scheduled, but schedules the pod to the node containing the storage device. It doesn't allow for pods to access local storage outside the node. So for worker nodes using storage on the master node, isn't it better to use either iSCSI or NFS…

This is exactly right. Local storage is conceptually the persistent volume equivalent to an emptydir volume mount.

If you want to have a 'storage node' in a simple way, the NFS storage provider is the way to go. You install the nfs client libs on each node, setup an NFS share and configure and run the provisioner[1].

My experience with iSCSI is to stay the heck away from it. It is not what you want. iSCSI is really meant for people who already have iSCSI SANs and not people who have a disk they want to share. The more I learned about it, the more I learned that I should have picked something else for every use. It's not that it's bad, it's that it solves a much different problem than I expected given the networked nature of it.

[1] https://github.com/kubernetes-incubator/external-storage/tre... (I think this is the right one, been a while).

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#69

Earlier quoted context omitted.

Your Kubernetes node itself is Linux, so requires virtualization if your host machine is not Linux. Docker for Mac also works this way; when you run a container, it's running on a Linux VM that Docker sets up, not on your Mac directly. Even on Linux, minikube uses a separate VM. It's just cleaner than having the kubelet running on your workstation directly. (microk8s takes a different approach and runs on your machin…

> Your Kubernetes node itself is Linux, so requires virtualization if your host machine is not Linux. Thus my question: If the aim is to use the machine for a Kubernetes "cluster", why not boot proper Linux on it, so Kubernetes can run at full speed, without any VM overhead?

With processor support for virtualization, the overhead is minimal. I personally use a Windows machine at home (for games, sigh) and run VMs for a Linux development machine and a few k8s nodes for testing. The performance inside the VMs is excellent.

I think right now if you want to have a single-node testing cluster, you will be very happy with minikube and the VM it creates. If you want multiple nodes, you will be very happy with VMs; you can create, destroy, and inject errors right from the command-line without having to walk over to physical machines and manipulate them.

Re: Converting an old MacBook into an always-on personal Kubernetes cluster

#70
post #51

Earlier quoted context omitted.

You're betting on the technology demand to move to certain direction. To me it feels like investing in stocks, but instead of betting with your money you are betting with your time and brain cycles invested. What makes you so confident that this piece of technology will flourish compared to so many others?

Kuburnetes is lightweight, extensible and based on open standards, which is the recipe for a long-term solution in this space. It also has first class support in all of the major cloud providers and has an established tooling ecosystem around it.

I'll agree with everything here besides 'lightweight'.
Post reply on HN