Looking for a Heroku replacement, What I found was shocking! ============================================================ Your browser does not support the audio element. Date: December 4, 2023 Your browser does not support the audio element. I've long hosted my personal blog as a static site on waylonwalker.com. It's all markdown, converted to html, and shipped as is. It's been great, I've moved it from GitHub Pages, to Netlify, tried Vercel for a minute, and have landed on Cloudflare Pages. Each migration has not really been that hard, it's just pointing ci to a different host after the site has built. [1] ## What about server side Now the part that I have struggled with is how to cheaply host a server rendered application that can just live on forever without me paying for it. This is a harder problem as it costs more to keep servers spinning, memory, and disk all ready for you to use at a moments notice. ## Honestly If you don't have a $1M problem to solve don't bother cause k8s will create a $1M problem for you. ## Let's jump on k3s [6] I've never ran kubernetes myself, but after seeing it so many times in my searches for a fly.io replacement, I decided to give it a shot. I chose k3s as it seems like a nice balance of easy to setup, maintain, and feature complete kubernetes service. ```bash # install and start k3s curl -sfL https://get.k3s.io | sh - # check to see if your nodes are started sudo kubectl get nodes ``` My main hiccup so far was the machine I am running on runs a fairly new ubuntu install with zfs on root, and it would not start the master node. Rather than figuring out how to make zfs play nice I just pointed k3s to a drive that is not zfs. ```bash # manuallly sudo k3s server -d /mnt/vault/.rancher/k3s # without editing systemd service sudo ln -s /mnt/vault/.rancher/k3s /var/lib/rancher/k3s ``` Next I needed to be able to completely manage my k3s cluster form my main machine while this one sits far away in a closet. ```bash # from the server sudo cp /etc/rancher/k3s/k3s.yaml ~/.config/kube # from my local machine scp falcon@falcon:~/.config/kube/k3s.yaml ~/.config/kube/falcon-k3s.yaml sudo cp /etc/rancher/k3s/k3s.yaml /home/waylon/.config/kube sudo chown -R waylon:waylon ~/.config/kube export KUBECONFIG=~/.config/kube/k3s.yaml ``` ## kompose Since everything I was running prior was in docker compose, I found kompose.io to be a fantastic tool to help me start converting my docker deployments into kubernetes. [7] ## A Month Later I started this post a month ago, and I am still enjoying k3s. For clarity, I did have a bit of k8's experience going in, but zero experience running it by myself. k3's seems to have made it pretty straightforward so far. My worst issues have been with ingress. Docker registries were a bit of a pain due to their large blob sizes, and a service I wanted to try to self host (sshx) required grpc, which is not supported by cloudflare tunnels. ## TLDR Don't believe everyone's pre-conceived notions about tech you have never tried. Most of these things come from the echo chamber that is twitter anyways. Create your own opinions by trying new things, learning for yourself, and forming your own opnions. References: [1]: https://pages.cloudflare.com/ [2]: https://heroku.com [3]: https://fly.io [4]: https://www.cloudflare.com/products/tunnel/ [5]: https://kubernetes.io/ [6]: https://k3s.io/ [7]: https://kompose.io/