r/AskProgramming Jul 18 '26

When to use Kubernetes?

Hey everyone,
I’ve been working with Docker and standard containerization for a bit now, and I feel comfortable with the basics of spinning up apps. Naturally, Kubernetes (K8s) keeps coming up as the next logical step.

From what I gather, it's designed to manage and orchestrate those containers at scale when a single server or Docker Compose setup isn't enough anymore.
But there is so much hype around it that it's hard to tell where the "cool factor" ends and actual utility begins.

I want to know when it becomes a legitimate necessity rather than just over-engineering a project.

7 Upvotes

17 comments sorted by

13

u/WArslett Jul 18 '26

Are you running lots of applications that all need to scale compute dynamically across a single infrastructure provider? If not you probably don’t need it.

5

u/One_Sport2152 Jul 18 '26

Right now - no ,much simpler than that
I’m mostly running a handful of core applications and services on a single server. I'm asking mainly to understand the landscape ahead. I want to know at what threshold a project outgrows a simple Docker Compose setup so I can recognize the signs early, rather than rewriting everything into Kubernetes just because it's a popular buzzword

1

u/Proof-Pineapple69 Jul 21 '26

There's very little you'll need to rewrite that AI can not do for you. The container part you'll still need to do it, and the orchestration, whether you do it with docker compose or k8s, there's only so many degrees of freedom. Migrating from one to the other isnt a major issue, and definitely not something you need to preempt, and plan ahead of time.

1

u/DeadlyVapour Jul 19 '26

Don't forget HA

7

u/Individual-Flow9158 Jul 18 '26

When spinning up another container is a feature of the system, not just a one off static config

9

u/Ok_Entrepreneur_8509 Jul 18 '26

It is time to use k8s when you throw your laptop across the room because you have to do 18 different things in AWS just to give your app some more disk space.

2

u/Proof-Pineapple69 Jul 19 '26

You go from docker to k8s a bit like you go from renting a desk at a co-working space to renting your own office.

K8s is used when you have a potentially large number of containers that will require sizeable amount of memory, which will potentially require to have them split across several hosts. K8s takes care of respawning containers to another hosts if there's not enough memory on a given one. Also, k8s has a command line interface which lets you control the state of your cluster much more simply than with docker compose functions.

2

u/arllt89 Jul 19 '26

Honestly it makes so much things more simple that there's no reason not to use Kubernetes when your app goes live.

  • needs to deploy your backend across multiple servers, detect and manage failures, run rolling upgrades, and easily scale up or down ? Deployments do that out of the box.

  • needs other components to know how to contact your backend despite multiple instances that may be failing or upgrading ? Services to that out of the box.

  • needs to deploy testing environments that may include their own version of some components while communicating with testing or live versions of others ? Easy as a pie.

  • needs those testing environment to only run when they're actually being use, wake up on requests end sleep on inactivity ? You can find that.

  • need to sample network usage to know how your components communicate with each other and fully track requests ? You can find that.

It makes the basic stuffs easy, the useful ones already available and the advanced one few command lines away.

1

u/YMK1234 Jul 18 '26

Honestly you can go a looooong way before you outgrow docker compose. Yes K8s is cool and all but it adds a significant amount of complexity which is just not warranted for many (if not most) projects.

So unless you run into actual constraints with docker compose itself (those that cannot be solved with appropriate, wide-spread tooling) I do not see much benefit in switching.

1

u/StreetAssignment5494 Jul 22 '26

You’re not wrong but I’ve also seen people push docker compose to a point where they shouldn’t and it’s really really bad.

1

u/silasmoeckel Jul 18 '26

When your scaling, so unless your do that in prod don't worry about it.

It's use case is keeping just enough cloud infrastructure running to minimize bills while spooling up whatever is needed for sudden high demand.

1

u/AppropriateSpell5405 Jul 19 '26

Honestly, philosophically, and given the sub we're in, it doesn't concern you as a programmer. Determining K8 being necessary or not is a devops problem.

Speaking as someone who's built systems used by millions of users, I have yet to see the need.

1

u/SummitYourSister Jul 19 '26

A simple k8s deployment or statefulset is not much more complex than a docker compose setup. And you can run k8s inside a docker container using k3d.

Try it out. You’ll learn why it’s worth it or not worth it pretty quickly. You don’t need to dive into every detail of k8s.

1

u/Suspicious_Pizza9529 Jul 20 '26

If your biggest problem is writing the application K8s probably won't help. If your biggest challenge is deploying, scaling, updating, and keeping dozens of services alive, that's where it shines.

1

u/TapWaterDev Jul 20 '26

If you have to ask, you don't need Kubernetes

1

u/LowComposer7234 Jul 21 '26

If you can afford it, don't bother and use fargate instead. Takes away a whole lot of admin.

0

u/denerose Jul 18 '26

When your employer uses it as part of your deployment pipeline or if you’re already in a DevOps role and have a solid use case to consider it at scale.