News for hackers. Stuff that matters.
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @08:42AM (#31976417)
I agree entirely.

I like to call what the author is referring to as, "What-If Engineering". It's the science of thinking you'll be Google next week, so you build for that level of scale today. It involves picking extremely complicated, expensive (both in compute and skilled labour) technologies to deploy a Rails app that has two features. And it all boils down to, "But what if..." pre-optimising.

It happens at all levels.

At the individual unit level: "I'll make these four lines of code a function in case I need to call it more than once later on - you know, what if that's needed?"

It also happens at the database level: "What if we need to change the schema later on? Do we really want to be restricted to a hard schema in MySQL? Let's use MongoDB".

What's even worse, is Helm and the likes make it possible to spin up these kinds of solutions in a heart beat. And, as witnessed and evidenced by several comments below, developers think that's that... all done. It's a perfect solution. It won't fail because K8s will manage it. Oh boy.

Start with a monolith on two VMs and a load balancer. Chips and networks are cheaper than labour, and right now, anyone with K8s experience is demanding $150k + 10% Superannuation here in Australia... minimum!

https://martinfowler.com/bliki/MonolithFirst.html

Re:Kubernetes is a red flag signalling premature optimisation by danielvaughn on Monday July 04, 2022 @08:50AM (#31976478)
I've told this story before on HN, but a recent client of mine was on Kubernetes. He had hired an engineer like 5 years ago to build out his backend, and the guy set up about 60 different services to run a 2-3 page note taking web app. Absolute madness.

I couldn't help but rewrite the entire thing, and now it's a single 8K SLOC server in App Engine, down from about 70K SLOC.

Re:Kubernetes is a red flag signalling premature optimisation by spidermanjones on Monday July 04, 2022 @02:25PM (#31980291)
My most recent job, and the job before that and the job before that all have one thing in common:

Someone convinced the right person to “put stuff on kubernetes” and then booked it for another job/greener pastures with barely any production services, or networking configured.

Thus an opening for a new SRE and once again I find myself looking at a five headed monster of confusing ingress rules, unnamed/unlabeled pods, unclaimed volume specs…

Sigh.

Re:Kubernetes is a red flag signalling premature optimisation by aabbcc1241 on Sunday July 17, 2022 @03:49AM (#32125170)
That is a real life story of "drink too much kool-aid"
Re:Kubernetes is a red flag signalling premature optimisation by ezekiel11 on Monday July 04, 2022 @01:18PM (#31979494)
absolutely nuts to think what that would look like. Is he building services to abstract out english grammar? Have one service called VerbManager that returns a boolean if a given word is a verb, have another one called AdjectiveManager that does similar and so on.
Re:Kubernetes is a red flag signalling premature optimisation by javajosh on Monday July 04, 2022 @10:42AM (#31977574)
What's your plan when (not if) Google deprecates GAE?
Re:Kubernetes is a red flag signalling premature optimisation by danielvaughn on Monday July 04, 2022 @11:09AM (#31977856)
Eh, it's just a simple node server, no real attachments to GAE. I could move it over to Digital Ocean or something within a day or two.
Re:Kubernetes is a red flag signalling premature optimisation by gizzlon on Monday July 04, 2022 @11:08AM (#31977840)
Not OP, but App Engine have actually been around for a long time.

Also, there's no inherent lock-in, you can basically just deploy it somewhere else.

Data is where the lock-in lies. Moving can be hard if you use proprietary databases. Can still be worth it.

Re:Kubernetes is a red flag signalling premature optimisation by danielvaughn on Monday July 04, 2022 @11:10AM (#31977866)
Yeah the one good decision by that former dev was to use Mongo Atlas, so the data layer is completely decoupled from GCP.
Re:Kubernetes is a red flag signalling premature optimisation by javajosh on Monday July 04, 2022 @11:56AM (#31978468)
>App Engine have actually been around for a long time

That means very little, I hope you realize. Reader, Voice, Chat, etc.[0] were all around a long time.

>Also, there's no inherent lock-in

GAE has plenty of proprietary APIs you can depend on. Whether or not you do is up to the programmer.

0 - A comment below notes that voice and chat aren't deprecated yet. Voice was announced deprecated, and google has had so many chat apps I'm not sure which ones are gone. Anyway, here is a more complete list of things Google has abandoned: https://killedbygoogle.com/

Re:Kubernetes is a red flag signalling premature optimisation by joshuamorton on Monday July 04, 2022 @12:29PM (#31978861)
Gae is nearly twice as old as reader was when deprecated. Voice and chat still exist and aren't deprecated.
Re:Kubernetes is a red flag signalling premature optimisation by likortera on Tuesday July 05, 2022 @01:07AM (#31984530)
It is very likely that GAE will last a lot more than the Kubernetes cowboy you hired to set up the undocumented and untested version of it in house.
Re:Kubernetes is a red flag signalling premature optimisation by preommr on Monday July 04, 2022 @09:14AM (#31976667)
> It's the science of thinking you'll be Google next week,

There's other reasons to use K8s than just thinking of massive scale.

Setting up environments becomes a massive PITA when working directly with VMs. The end result is either custom scripts, which is a messier version of terraform, which ends up being messier than just writing a couple of manifest files for a managed k8s.

> anyone with K8s experience is demanding $150k + 10% Superannuation here in Australia... minimum!

sheds a tear for CAD salaries and poor career decisions

Re:Kubernetes is a red flag signalling premature optimisation by ryanbrunner on Monday July 04, 2022 @09:38AM (#31976899)
> Setting up environments becomes a massive PITA when working directly with VMs. The end result is either custom scripts, which is a messier version of terraform, which ends up being messier than just writing a couple of manifest files for a managed k8s.

The author advocates using a high-level PaaS. For sure working directly with VMs is the wrong answer to premature optimization, but as an early stage startup, there's plenty of services around that you basically just need to point your Git repo at and you'll have a reasonable infrastructure set up for you.

Re:Kubernetes is a red flag signalling premature optimisation by tenfourty on Monday July 04, 2022 @09:46AM (#31976975)
OP here, I agree. You can get super far with a service like fly.io/Heroku/Netlify/Vercel etc. (pick the one that works with your stack). VMs are an anti-pattern as well for the early stages of an application or startup.
Re:Kubernetes is a red flag signalling premature optimisation by mbonca on Wednesday July 06, 2022 @09:43AM (#32000773)
I find those solutions end up being harder once you have to integrate something new you didn't know you needed. And the cost, at least for something like Heroku, is MORE than using something like GKE where I don't need a new dyno for every service. I consider GKE (and DO's and AWS's equivalent k8s solutions) on the same platform level as a fly.io/Heroku/etc.
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:21PM (#31981910)
> Setting up environments becomes a massive PITA when working directly with VMs.

I guess I've just never found this to be true.

My main goal when engineering a solution is always, "Keep It Super Simple (KISS), so that a junior engineer can maintain and evolve it."

Working directly with operating systems, VMs, networking, etc. (purely in Cloud - never on-prem... come on it's 2022!) is the simplest form of engineering and is much easier than most claim.

Re:Kubernetes is a red flag signalling premature optimisation by osigurdson on Monday July 04, 2022 @09:12AM (#31976656)
>> Helm and the likes make it possible to spin up these kinds of solutions in a heart beat

Genuine question, why is this bad? Is it because k8s can spin it up but becomes unreliable later? I think the industry wants something like k8s - define a deployment in a file and have that work across cloud providers and even on premise. Why can't we have that? It's just machines on a network after all. Maybe k8s itself is just buggy and unreliable but I'm hopeful that something like it becomes ubiquitous eventually.

Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:18PM (#31981885)
Oh it's most certainly NOT bad! It's very, very good. But it's not the end of the story. Imagine if you could press a button in a recipe book and a stove, pan, some oil, and some eggs appeared and the eggs started cooking... amazing! But that's not the end of the story. You don't have scrambled egg yet. There's still work to be done and after that, there's yet more work to be done - the washing up being one of them.

It's everything that comes afterwards that gets neglected. Not by everyone, granted, but by most.

Re:Kubernetes is a red flag signalling premature optimisation by roguas on Wednesday July 06, 2022 @12:46PM (#32003515)
Its bad because kubernetes has a learning curve + typically you'll need someone to deal with it constantly. If your app is simple, you don't need that - simple docker-compose should suffice.
Re:Kubernetes is a red flag signalling premature optimisation by jbverschoor on Monday July 04, 2022 @06:00PM (#31982184)
We had J2EE almost 30 years ago. 1 file which described everything and contained everything
Re:Kubernetes is a red flag signalling premature optimisation by osigurdson on Monday July 04, 2022 @10:53PM (#31983812)
According to the following link, that literally sounds nothing like Kubernetes. Perhaps a more appropriate analogy to older tech is something like LSF or Slurm.

https://www.webopedia.com/definitions/j2ee/

Re:Kubernetes is a red flag signalling premature optimisation by scheme271 on Tuesday July 05, 2022 @03:22AM (#31985332)
LSF and Slurm is still around and kicking on HPC systems. But they're nothing like kubernetes. Maybe close to k8s batch jobs but that's it.
Re:Kubernetes is a red flag signalling premature optimisation by osigurdson on Tuesday July 05, 2022 @09:51AM (#31988184)
Finding machines with available cores and memory to run a workload is the fundamental feature that they share.
Re:Kubernetes is a red flag signalling premature optimisation by mountainriver on Monday July 04, 2022 @10:32AM (#31977454)
Sorry but managed k8s is really simple and wildly a better pattern than just running VMs. You don’t need google scale for it to help you, and spinning things up without understanding the maintenance cost is just bad engineering
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:29PM (#31981959)
> Sorry but managed k8s is really simple ...

If you need a service to manage K8s for you, then that's a red flag already (regarding K8s, not you personally.) If the service is so complicated that experienced engineers tell me constantly that only managed K8s is the way to do it, that tells me enough about why it's going to be a rough journey that should probably be avoided with IaaS or PaaS.

> ... and wildly a better pattern than just running VMs.

I've never had an issue running VMs, personally. And when I join a firm and begin helping them, I find I can very quickly and easily come up to speed with their infrastructure when it's based on straight IaaS/SaasS/PaaS. If it's K8s, it's often way more complicated ("Hey! We should template our YAML configs and then use Ansible to produce the Helm charts and then run those against the infra!" - ha ha!)

Re:Kubernetes is a red flag signalling premature optimisation by mountainriver on Tuesday July 05, 2022 @11:41AM (#31989561)
> If you need a service to manage K8s for you, then that's a red flag already

It's really not, k8s does a ton for you, trying to do the same with VMs would be unbelievably complex

> that should probably be avoided with IaaS or PaaS.

PaaS is great till it isn't, seen plenty of companies hit the edges of PaaS and then need to move to k8s

> infrastructure when it's based on straight IaaS/SaasS/PaaS

Again this is great till it isn't (see heroku) and then people move to k8s. Having control and understanding of the underlying infrastructure is important unless your just running some basic web app

Re:Kubernetes is a red flag signalling premature optimisation by watermelon0 on Monday July 04, 2022 @12:12PM (#31978643)
You want simple? Heroku, Render, DigitalOcean AppPlatform
Re:Kubernetes is a red flag signalling premature optimisation by mountainriver on Tuesday July 05, 2022 @11:42AM (#31989586)
Yeah isn't Heroku dead? PaaS is great till it isn't then you're screwed, seen plenty of companies be forced to move off of PaaS to k8s because of the edges. Its fine if you are running a basic web app
Re:Kubernetes is a red flag signalling premature optimisation by mirceal on Monday July 04, 2022 @11:33AM (#31978160)
No, it's not. If going for managed services: A load balancer + an asg is stupid simple to setup and it just works.
Re:Kubernetes is a red flag signalling premature optimisation by zinclozenge on Monday July 04, 2022 @01:20PM (#31979527)
How do you deploy your code in this scenario, ssh into VMs?
Re:Kubernetes is a red flag signalling premature optimisation by mirceal on Monday July 04, 2022 @03:42PM (#31980972)
Level 1) you package your service into a zip/rpm/deb/etc and have an agent on the machine that periodically pulls

Level 2) you pack your software into an ami and use the update the asg config. You can periodically "drain" the asg of old instances

Level 3) you deploy your stack again with the new stack having the ami that you've build at level 2 referenced. You start shifting traffic between the old stack and the new stack. You monitor and rollback if something is wrong.

Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:25PM (#31981938)
I find it's easier to use Ansible/Salt/Puppet Bolt and Packer to bake an AMI every night, update the launch template in a DB (which Terraform pulls the value from, thus there is no drift), and auto the ASG. Then you just force a drain.

Now you've got automatic, constantly updating VMs every night if you want them. And a new deployment is just commiting code to master and pushing and that whole pipeline triggers for you.

People like to overcomplicate things, Mirceal. You're on the right path :-)

Re:Kubernetes is a red flag signalling premature optimisation by 0xCAP on Monday July 04, 2022 @04:03PM (#31981178)
Worst solutions I've heard in a while, no offense...
Re:Kubernetes is a red flag signalling premature optimisation by mirceal on Monday July 04, 2022 @04:16PM (#31981307)
sure thing. share your solutions and why the are better?
Re:Kubernetes is a red flag signalling premature optimisation by nouveaux on Monday July 04, 2022 @05:19PM (#31981899)
I'll be honest I haven't fully explored AMIs as a solution but how do you run the AMI in your local dev environment? I can replicate the same K8s with docker images easily in local dev.
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:23PM (#31981926)
If you can't run your software locally without Docker, I'd be worried.

But to answer the question, VMs have been a thing on the desktop for a very long time.

Re:Kubernetes is a red flag signalling premature optimisation by mirceal on Monday July 04, 2022 @08:53PM (#31983186)
that's the crux of the problem. people no longer know, understand or want to know and understand what their software is vs what is around their software. they treat docker and k8s as a way of packaging software and just ignore all the lessons that generations of software engineers have learned when it comes to how to properly manage your dependencies and how to correctly pack your software so that it's resilient and runs anywhere.

we also live in a world that does not appreciate well crafted software and a lot of things are driven by the desire to build a resume. I've maintained code that was decades old and was amazing to work with and was still generating ridiculous amounts of money. I've also worked on code that was just written and used all the possible bells and whistles and development speed grinded to a halt once the it's been around for more than a couple of months.

My worst case scenario is having to work on code where the original developer didn't understand what they were doing and they just wanted to use X. Double the trouble if they didn't master X when the thing was put together.

Re:Kubernetes is a red flag signalling premature optimisation by nouveaux on Monday July 04, 2022 @07:12PM (#31982654)
How do you download AMIs of Redis, Postgres, etc? Are you building this all by hand?
Re:Kubernetes is a red flag signalling premature optimisation by mountainriver on Tuesday July 05, 2022 @11:47AM (#31989681)
A basic k8s service is just as easy if not easier and takes you way further
Re:Kubernetes is a red flag signalling premature optimisation by d23 on Monday July 04, 2022 @09:19AM (#31976719)
The truth is at scale the last thing you want is a nest of unmanaged complexity, so it’s also the wrong instinct there. It’s usually contact with the real world that dictates what needs the extra engineering effort, and trying to do it ahead of time just means you’ll sink time up front and in maintenance on things that didn’t turn out to be your problem.
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:31PM (#31981972)
I think at scale, K8s is a good choice. I run a Discord server with like, 3,400 members now, and some of them are working at mental scale. They've claimed the same as you: K8s at scale is the only way.

I would very likely agree in all cases.

However, they only represent 4-5 users out of all 3,400. And that's the issue - only a small fraction of the industry operates at that scale :-)

Re:Kubernetes is a red flag signalling premature optimisation by iso1631 on Monday July 04, 2022 @08:45AM (#31976440)
You're forgetting that many people will want to use K8s for a project because they want it on their CV to get the high paying jobs. I saw the term on HN a couple of weeks ago -- CVOps
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @08:47AM (#31976454)
I'm not forgetting that fact, I'm simply choosing to ignore such people. They're not really what the industry is about. That's not in the spirit of a healthy society. That's just leeching.

Good luck to them, but they're not going to occupy time and space in my mind.

Re:Kubernetes is a red flag signalling premature optimisation by jjav on Monday July 04, 2022 @10:21AM (#31977334)
> They're not really what the industry is about.

We'd like that (I'd like that), but resume-driven choices are a very large driver of technology direction, unfortunately.

It means those of who want to build something very maintainable and very stable using the most boring (stable, secure) technology possible are often outnumbered.

Re:Kubernetes is a red flag signalling premature optimisation by NoGravitas on Tuesday July 05, 2022 @09:16AM (#31987843)
And underpaid.
Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:33PM (#31981990)
Sigh. Tell me about it :-/
Re:Kubernetes is a red flag signalling premature optimisation by iso1631 on Monday July 04, 2022 @10:17AM (#31977300)
Maybe it's just my organization, but I see the behavior across the corporation far more than I'd like, and inevitably these people move on leaving a complex mess in their wake that long term support staff have to deal with.

We seem to mostly manage to avoid that in my department, but we have a very low turnover.

Re:Kubernetes is a red flag signalling premature optimisation by movedx on Monday July 04, 2022 @05:32PM (#31981987)
Sounds rough, buddy! Sorry to hear that. I hope you're being well compensated.
Re:Kubernetes is a red flag signalling premature optimisation by morelish on Monday July 04, 2022 @09:16AM (#31976691)
> I'll make these four lines of code a function in case I need to call it more than once later on - you know, what if that's needed?

The code example is not always right.

Beware, if you know it will be needed, you might as well make it a function now. Likewise if you think probably it will be needed, why not make it a function now?

It’s not a good review comment or rejection to say “yeah but I don’t want to do that because it’s not yet needed”. Sure, but what if you are just being lazy and you don’t appreciate what it should look like long term?

The “I don’t want to write a function yet not needed” is not a clear cut example.

Re:Kubernetes is a red flag signalling premature optimisation by _gabe_ on Monday July 04, 2022 @09:33AM (#31976843)
> Sure, but what if you are just being lazy and you don’t appreciate what it should look like long term?

I wasn't aware that some devs have a side hustle as fortune tellers?

On a more serious note, you should take a look at Sandi Metz's "the wrong abstraction". https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction

Re:Kubernetes is a red flag signalling premature optimisation by woojoo666 on Monday July 04, 2022 @02:19PM (#31980228)
You're making a gamble either way. The article you linked is correct that duplication is usually cheaper than abstraction. So if you really have no idea what your code will do in the future, then cheaper is the way to go. But an experienced dev can start to fortune-tell, they know what parts tend to be re-used, which abstractions are common and powerful. And if you also plan your architecture before you code, you can also see what abstractions might be needed ahead of time. If you are sure an abstraction is better, then duplication is tech debt.

A simple example. If you are making a multi-page website that contains a header on all pages, you can separate the header into a component from the get go, instead of duplicating the header for each page and then abstracting it in the future (where it starts to become more work).

Re:Kubernetes is a red flag signalling premature optimisation by roflyear on Monday July 04, 2022 @08:52AM (#31976488)
At least in the sense of code you arent doing any real harm I can think of and there are other benefits like testing and organization.
Re:Kubernetes is a red flag signalling premature optimisation by Jistern on Monday July 04, 2022 @08:50AM (#31976479)
>> I agree entirely.

I agree entirely too.

>> Start with a monolith on two VMs and a load balancer. Chips and networks are cheaper than labour,

Kudos to you! You are a dangerous man for you opine the truth.

My advice is generally, "Build something. Then see if you can sell it." or "Sell something and then go build it." Either way, it all starts soooo small that the infrastructure is hardly a problem.

If you "get lucky" and things really take off. Sure. Yeah. Then get a DevOpps superstar to build what you need. In reality, your business will very probably fail.

Re:Kubernetes is a red flag signalling premature optimisation by politician on Monday July 04, 2022 @09:04AM (#31976581)
You can’t just hire 1 DevOps superstar though because they need to sleep and not burnout. You’ll need ~7 people on a rotation if you need to really support anything worth really supporting. DevOps is about giving Developers a dedicated System Operations job for some small fraction of their time.
Re:Kubernetes is a red flag signalling premature optimisation by jen20 on Monday July 04, 2022 @10:55AM (#31977706)
> DevOps is about giving Developers a dedicated System Operations job for some small fraction of their time.

No. DevOps is about the development and operations disciplines working together in a cross functional way to deliver software faster and more reliably.

In a small enough startup both disciplines may be represented by a single person, though.

Re:Kubernetes is a red flag signalling premature optimisation by politician on Monday July 04, 2022 @09:06PM (#31983254)
I respectfully disagree. I’ve scaled these teams myself, and it’s about giving developers in a small organization the job of deploying the solution and ensuring that it runs. In larger organizations, DevOps becomes impossible and it naturally splits into Dev and Ops. It’s important to understand where it works and when it stops working to effectively manage the transition as the business grows.
Re:Kubernetes is a red flag signalling premature optimisation by jen20 on Tuesday July 05, 2022 @09:24PM (#31995756)
> In larger organizations, DevOps becomes impossible

News to me. I work at one the biggest companies around, and our DevOps posture is pretty great, and that was achieved by cross functional teams from the historic dev and historic ops teams doing all the things that Accelerate codified.

Re:Kubernetes is a red flag signalling premature optimisation by jjav on Monday July 04, 2022 @10:18AM (#31977311)
> You can’t just hire 1 DevOps superstar though

You don't go from zero to needing global 24x7 support overnight.

Hiring 1 DevOps superstar is exactly what we did a few startups back and it worked great. Of course there was no after-hours support, it's a small startup. Eventually the team grew.

Re:Kubernetes is a red flag signalling premature optimisation by politician on Monday July 04, 2022 @09:08PM (#31983262)
Fair enough. If you don’t need 24/7 and the bus factor risk is tolerable, then you might not need a rotation.

I’d just caution that when it comes to the mental health of the one person in this role, even if they seem like they are doing ok, check in frequently.

Re:Kubernetes is a red flag signalling premature optimisation by Jistern on Monday July 04, 2022 @09:12AM (#31976646)
Good grief. First and foremost I was simplifying to make a point.

>> You can’t just hire 1 DevOps superstar

Secondly, that assertion is not necessarily true. Obviously, you should just hire 1 DevOps superstar... in some cases.

Don't nitpick and don't argue foolishly.

Re:Kubernetes is a red flag signalling premature optimisation by politician on Monday July 04, 2022 @09:35AM (#31976865)
I’ve run DevOps and know from experience the pitfalls. I’m sorry that you’ve interpreted my general agreement and elaboration of your comment as nitpicking foolishness.
[dead]
Re:Kubernetes is a red flag signalling premature optimisation by dang on Monday July 04, 2022 @06:58PM (#31982564)
We've banned this account for repeatedly breaking the site guidelines.

https://news.ycombinator.com/newsguidelines.html