to the cloud and back

Over the years, my web presense has shifted from various managed web hosting services, to VPS providers, and in recent years, to the cloud.

I have been using AWS to host this site and a few others for a few years now and in my day job I work with all the major cloud providers daily.

This post isn't about extolling the virtues of the cloud - the fact that we see a significant migration from on-prem / managed DCs to the cloud is testament alone to the value-add of the cloud.

Instead, this post is more about the journey of my web presence from on-prem, to the cloud, and ultimately coming full circle to self-hosting.

The early days (for me)

I first joined the world wide web in the mid-90s, right ahead of the dot-com boom and the rise of web2. I started doing basic web development, focusing primarily on PHP, and my first few projects were hosted right on my home computer.

Obviously this does not scale well, and I quickly found myself hosting on various shared hosting providers, which served me well for a few years until I ended up moving to a collection of VPS providers for more control over the environment as well as cost optimization.

To the cloud

AWS's collection of Goldilocks services allows customers to pick-and-choose the services they want to use to host their web presence. As is often the case with cloud migrations, my fist footprint was simply a few EC2s on which I directly deployed my services.

As the cloud - and tech industry as a whole - matured, I started to branch out to take advantage of other services such as RDS, CloudFront, S3, and Route53. These fully-managed services make it extremely easy to get a new platform up and running, however that convenience comes at a cost.

The rise of Kubernetes

I like to think of K8s as "my cloud in the cloud". The abstraction layer K8s provides between the software and the hardware enables developers to build truly environment-agnostic applications that can be deployed (and migrated) effectively anywhere that speaks the Kubernetes API.

I've been using K8s in my professional career for years now, and for R&D / side projects, I have been running a homelab cluster using Rancher K3s. This operational lingua franca meant that once a R&D project matured, I was able to quickly and easily deploy it to any of my available cloud K8s clusters, with no additional configuration or setup.

The return to self-hosting

I've been self-hosting various services for my home for years, and I am an avid follower of the /r/selfhosted and associated communities, and I'm always on the lookout for ways to reduce my reliance on third-party services.

Up until recently, I've maintained a hard deliniation between my "on-prem" cluster and my public web presence. This was done for many reasons including security, scalability, uptime concerns, and cost.

Over the past few months I have been working on a side project in the web3 space (I'll probably post about this at some point). A few of the services in this project are quite resource intensive, and I soon found my AWS bills to be quite high after just a few days of running the public environment. This was expected, but it was also a great impetus to reconsider my hosting strategy.

My homelab cluster is quite robust, and at the time of writing this, I have nearly a dozen nodes across various enterprise, prosumer, and some repurposed consumer devices providing additional GPU and interface support.

The real limitations of my cluster are that it is all hosted in a single "zone" - that zone being my garage. I have a dedicated fiber network, failover power supply, and redundant RAID storage across multiple independent storage servers with regular automated offsite backups.

As my entire cluster and all applications is bootstrapped through gitops, I can easily deploy new applications and services to the cluster without having to worry about downtime.

With the maturation of my homelab to be effectively more robust that many "production grade" environments that I have come across in the past, and with the massive AWS bills as a catalyst, over the course of just a couple of days, I was able to migrate (nearly) my entire web presence off of the cloud and onto my on-prem cluster.

With the use of small burstable proxy instances in the cloud securely connected to the on-prem environment via a VPN tunnel, I am able to present a public facing cloud IP address to the world while having that securely route into my on-prem environment.

Through the use of split horizon DNS, I am further able to make a seamless transition between the local and public environments.

As part of this migration, I have created quite a few new Prometheus exporters which I plan on making public on my GitHub after updating some documentation.

last updated 2022-08-20