News for hackers. Stuff that matters.
Re:You don’t need all that complex/expensive/distracting inf... by jrochkind1 on Thursday March 11, 2021 @09:32AM (#26424370)
Is there good tooling that's actually in between "just running a website out of my spare bedroom" and "kubernetes"?

I think maybe not.

Re:You don’t need all that complex/expensive/distracting inf... by deckard1 on Thursday March 11, 2021 @06:43PM (#26430481)
You're starting at the wrong point.

If you need scale, then you know what you need when you need it. None of this advice people are tossing around would apply to WhatsApp, for instance. Because they needed to get into the weeds on BEAM optimizations for Erlang and they needed to do so quickly. They probably didn't have a year to mess around getting K8S up and stable. Or crafting the perfect Ansible script. Or infrastructure-as-code. They probably cared very little about any of that.

WhatsApp is the closest thing you'll see for explosive growth. And they had time to work on BEAM patches. Think about that. Their whole world didn't just collapse because they couldn't support a billion connections on day one. Even they had time to scale as they needed.

Re:You don’t need all that complex/expensive/distracting inf... by skrtskrt on Thursday March 11, 2021 @10:53AM (#26425316)
A couple ansible scripts to deploy the k3s kubernetes distribution onto cloud VMs.*

Add LetsEncrypt to the Traefik install for https

Use the default Helm chart to make your k8s deployments for your apps - you'll probably only need to tweak a couple values to start - ports and ingress rules.

* k3s comes with Traefik pre-baked to listen on ports 80 and 443 so you can run it "bare metal" without a cloud provider's load balancer service or any special tweaks to Traefik config. If you just Helm install any of the standard k8s ingress providers like the standard Traefik chart, Consul, or Nginx, you have to tweak a bunch to get them working on privileged external ports 80 and 443.

Re:You don’t need all that complex/expensive/distracting inf... by theptip on Thursday March 11, 2021 @11:39AM (#26425937)
I found Dockerizing my app really early to be a good bridge to k8s.

Build container locally, test, push. On Linux box, pull the new app container, stop the old app container, start the new app container. Separate nginx reverse proxy also in docker so if you’re fast enough you don’t drop any packets.

I’d say docker is worth using from the get-go, but if you are most familiar with raw Linux probably just use that for your first iteration.

Re:You don’t need all that complex/expensive/distracting inf... by bearjaws on Thursday March 11, 2021 @09:43AM (#26424478)
Serverless compute in your favorite cloud provider IMO.

Been using serverless framework for over a year now, handles my deployments, load balancers, API gateway and obviously Lambda.

A proper CI/CD setup is only about 8 hours of work with a monolith app.

Re:You don’t need all that complex/expensive/distracting inf... by salmonlogs on Thursday March 11, 2021 @09:47AM (#26424522)
What about a managed service like EKS or GKE? A minimum k8s config is perhaps 20 lines to spin up a service and expose the ports - that feels pretty achievable for bedroom coder?
Re:You don’t need all that complex/expensive/distracting inf... by marcosdumay on Thursday March 11, 2021 @11:55AM (#26426158)
Machine installation manuals, "Create machine" shell scripts, manual docker, script launched docker, VM management tools... Well, technically, puppet and it's kind are there too, depending on whether you consider them viable or not.
Re:You don’t need all that complex/expensive/distracting inf... by didibus on Thursday March 11, 2021 @11:59AM (#26426205)
You can use something like AWS Application Load Balancer with two EC2 hosts behind it. Linode also offers an LB if you prefer Linode.

Now do a simple Blue/Green deploy. Deploy to the first host, so maybe you use Java so just have a script that shutdowns your app and copies over a new uberjar and starts it up again. Try it out, if it all works, swap the LB to point to this host instead. If it results in errors and failures your rollback procedure is to swap it back again to the previous host.

You can scale this pretty easily as well, just add more hosts behind your Blue/Green groups.

Now the last challenge is actually going to be your DB. You can't swap DB instances like that, so that's where something like AWS RDS or a managed DB service is useful, cause they often offer automatic replica and fail over.

But if you're lazier (or don't have the money) then that, just have a third host running PostgressSQL with a scheduled backup of your DB to some other durable storage like AWS S3. And when you need to update that host, schedule a maintainance window for your app/website.

So...

1) You can start with one single VM and have your DNS point directly to that host. Where the host runs your DB and your app. Deployments are you ssh-ing, shutting down, copying a new uberjar, starting up again. And you turn this into a script that does it for you.

2) Then you add a DB backup cron job to S3 so you don't lose all your users data from an incident.

3) Now if you want to prevent needing downtime when you deploy, you add an LB and move your DNS to point to the LB and put the host behind the LB, it becomes Green, and add another host which will be Blue, move your DB to a third host that's not behind the LB. And now do what I said earlier. You can now deploy new versions of your app without downtime, and do quick rollbacks in case you deploy something that breaks your users.

4) If your user base grows and one host isn't enough anymore, you can add more behind the Green and Blue groups. Everything else is the same, just your script now needs to swap between the groups.

5) Now you might start to want tests running automatically, uberjar being created automatically when you commit, and have a beta stage and all that. So you can setup a CI/CD pipeline. Have a test host and a test DB. And your app has config to know which environment it runs under to detect what DB to connect too.

6) Finally, if your DB becomes a scaling bottleneck due to growth, congratulations, you've now becomed a successful business and can just hire other people to deal with it.

Re:You don’t need all that complex/expensive/distracting inf... by herodoturtle on Friday March 12, 2021 @06:13AM (#26434488)
> Is there good tooling that's actually in between "just running a website out of my spare bedroom" and "kubernetes"?

Yes. Plenty.

One example is AWS Lightsail.

Re:You don’t need all that complex/expensive/distracting inf... by Macha on Thursday March 11, 2021 @07:40PM (#26430932)
docker-compose, ansible, chef in -z mode are all in that middle complexity level