The above question in a way is also my point which more bluntly can be said as, don't run something for the sake of running it and instead run tools you're knowledgeable in.
> Kubernetes was on fire
It might have been something as easy as conflicting IPs on your network that was causing the control plane not get kicked off or the nodes constantly disconnecting.
Something somewhat similar happened to me where my IoT lights caused a thundering hurd kind of problem on my network ip space related to some internet disconnect and I guess a bug in the code. They just kept conflicting IPs with each other and would just loop over the ip space they had. Never dealt with this before and just unplugging the whole switch for 5 mins resolved whatever infinite bug they had.
A general pattern I see in software is that it scales up much better than it scales down, and Kubernetes is definitely like that. I had hopes it would be useful and educational to run for personal projects, but it's just too heavy.
Am I missing out?
https://www.fractal-design.com/products/cases/node/node-304/...
ZFS is the hero here. I tried many solutions in the past (mdadm on ext, btrfs, XFS, hardware RAID) and got burned by rotten bits and confusing UX leading to user error data loss. But in the past 7 years running ZFS I haven’t lost a single bit, and been continuously impressed with the incredibly easy to use CLI and “intelligence” of the file system itself. Snapshots, send/receive, datasets, everything is just so well refined. It felt ahead of its time a decade ago, and still does today. Moving the file system from Linux to the FreeBSB based TrueNAS was effortless.
The older Gen8 boxes Just Work.
With FreeBSD, the newer Gen10 boxes would hang the first time you boot, you need to pause it and set the hw.pci.realloc_bars loader variable to 1. Haven't tried a new install recently. Details here: https://www.virten.net/2017/10/fix-for-freenas-on-hpe-micros...
The case was $120CAD, and the mobo/cpu/ram (i3) were another maybe 300.
Caveat: I’m not running ZFS, and just do classic “data lives in two places on-site and one off-site” backup
It's not the cheapest, but has idrac "remote control bios". So I never have to sit next to the box. It houses 4 disks + you can add SSDs via PC and it has ECC RAM. Plus I added a couple of years "Next business day on site" warranty, so I'm pretty safe against long downtimes.
Instead, I’d recommend getting a µATX tower with sound dampening preinstalled. The extra interior space also makes installation and maintenance a lot easier.
Also CI/CD is completely optional.
> So now, not only do you have to worry about the applications themselves and their configuration, but you also have to worry about all the layers on top of them.
The biggest benefit of K3s here imho is not scaling or performance but to have a standardized API to deploy standardized packages/containers/deployments (Docker/Helm) to. So instead of configuring and maintaining one of the many Linux flavours (and all those layers) out there I have one standard system to worry about.
I have a K3s Rpi cluster running for a few months now. Setup was trivial and maintenance as well. If I have a problematic node I just remove it from the cluster, reflash the SD card with a new install of K3os and put it back in. No state or further configuration to worry about.
All my previous homelab setups where either hand-crafted snowflakes or configuration managed by some tool (Puppet, Salt or Ansible). Each comes with its own problems but they all have the problem that they accumulate state over time and become to hard to manage.
As you said Linux does offer standardized packages, but they are not applications/deployments. To get them running, beyond installing the binary, still requires a lot of configuration. Nginx (proxy, tls), a database maybe, storage/LVM, firewall, etc. So you quickly run into tools like Puppet and Ansible to manage this. The disadvantage is that they don't reverse the changes they make. So if you want to try something out and deploy it with Ansible, there is no easy trivial way to undo it except for reverting all the changes individually. Also there is always the tempation to quickly tweak something by hand, forgetting to commit it to CM.
With a system like K8s, everything (container, volume, ingress) is a declarative configuration and the 'system' works to converge to the state you declared. If you delete something, K8s will revert all changes. So there will be no lingering state or configuration left. Making everything way more managable imho.
usage: deploy_app "commit message, push right to master!"
deploy_app () {
git add --all :/
git commit -m "$1"
git push
ssh user@server <<EOF
cd app/ &&
git reset --hard &&
git clean -df &&
git fetch &&
git reset --hard origin/master &&
sh scripts/deploy.sh
EOF
}
deploy.sh #!/bin/sh
set -e
# java
sh scripts/rebuild.sh java-api
# node.js
sh scripts/rebuild.sh api
sh scripts/rebuild.sh cron
sh scripts/rebuild.sh ui
sh scripts/rebuild.sh windows-api
sh scripts/rebuild.sh ws
# terraform
sh scripts/apply.sh
# nginx
docker restart nginx
# sql
sh scripts/migrate-database.sh
Rebuilds Docker images, taints the Terraform Docker resourcesCerts, ingress, cicd integration etc. all come out of the box
- Set up a k3s cluster
- Set up an ingress controller
- Set up a certificate manager
- Set up a Github actions pipeline to build and push Docker images
All of that to deploy a bunch of standard applications in a single server, with very low load. So now, not only do you have to worry about the applications themselves and their configuration, but you also have to worry about all the layers on top of them. And the guide sounds good and easy when you read it, but I wonder how much time will you spend implementing it, working out issues and quirks and adding new things compared to the time you'd need doing a standard installation with a regular Ubuntu, Debian, Fedora or whatever system. And the resource overhead is important too, specially in disk space (60G in system disk for a home server sounds like a lot to me).
I don't see the advantage here, honestly. I see a lot of moving pieces and complexity added and the only thing you seem to get out of it is an automated deployment, which is not very useful for a home server and also doable with simpler tools (you could even do it with a set of basic scripts that install software and copy configuration files).
Maybe it's more secure due to isolation, but for a simple home server you can (and should) protect yourself against 99% of the attacks by using 2FA for SSH, a firewall with only the ports you want opened (and possibly restricted to certain IP ranges) plus basic auth + HTTPS on Nginx with fail2ban.