Equal-Vote / terraform

3 stars 1 forks source link

Setup spot instances to save money #18

Open evanstucker-hates-2fa opened 3 months ago

evanstucker-hates-2fa commented 3 months ago

https://azure.microsoft.com/en-us/pricing/spot-advisor/

https://azure.microsoft.com/en-us/pricing/details/virtual-machines/series/

Conversation in Signal:

@mikefranze ...spending on average $3.50 a day Which still feels high to me compared to normal hosting costs.

@evanstucker-hates-2fa It's pretty cheap for a tech stack that we can take to any cloud provider that wants to fund us. We're hosting a website, keycloak, an two databases (one for star-server, one for keycloak). I can cut costs more - up to 90%* cheaper - by going to spot instances. I'll work on that after I get backups going.

@ArendPeter would spot instances add an initial latency if the service gets used after an initial down period?

@evanstucker-hates-2fa Looks like 72% cheaper is the real savings. Wow. Yeah, I'll work on that. And still need to figure out why ArgoCD is such a resource hog. If it weren't for that, we could probably go down to smaller instances too. Nope, spot instances would just be prone to shutting down sometimes, but as long as we have two nodes, we shouldn't have any outages... So the math is really 1 instance at $65/month or two instances at $18/month each ($36/month total). Ooo... or I could switch us to spot "D2ps v5" instances for only $7/month each... I wonder how those are different than our current ones? I'll look into all this stuff.

evanstucker-hates-2fa commented 2 months ago

We should look into https://karpenter.sh/ for this I think. https://learn.microsoft.com/en-us/azure/aks/node-autoprovision?tabs=azure-cli