Live data from Hacker News

Do I Need Kubernetes?

mbird.biz

111–120 of 180 posts

Re: Do I Need Kubernetes?

#111
post #6

> Run your applications in Docker from day 1 (with docker-compose it’s as valuable for dev as it is for production) and think carefully before letting your applications store local state. I think this is the key take away for many startups. Get it so you: 1. Have a single-command way to bring up your entire backend 2. That command can run on your dev machine 3. You document all of the settings for your containers and…

is there a performance hit with using databases inside docker?

yes, but due to docker networking overhead (supposing you are using a volume on the host, as you should).

Re: Do I Need Kubernetes?

#112

Here's a quick reference: 1) Are you on AWS? Then you don't need Kubernetes. Use Fargate. 2) Are you on Google Cloud? Then you don't need Kubernetes. Use Cloud Run. 3) Are you on Azure? Then you don't need Kubernetes. Use Azure Container Instances. 4) Are you on a PaaS like Heroku? Then you don't need Kubernetes. 5) Are you on a random VPC provider / bare metal machines? You could probably still do without Kubernetes…

I have devops engineers who need something to do otherwise they'll quit and move on to other companies that are working with kubernetes.

I think ^^^ the above is the main thing driving adoption. It's a real social engineering problem. Many engineers like to work with the latest and greatest.

Re: Do I Need Kubernetes?

#113

Earlier quoted context omitted.

I’m not avidly opposed to k8s by any means, but you can get these same properties from any of a variety of easier-to-use schedulers such as Fargate, Heroku, or even EC2 autoscaling groups. Of course, there are probably Kubernetes distributions that lower the threshold of using Kubernetes (and if there aren’t, there really should be) by providing solutions for logging, monitoring, certificate management, Functions (a…

> you can get these same properties from any of a variety of easier-to-use schedulers such as Fargate, Heroku, or even EC2 autoscaling group Serious question, as I don't have any experience of those, can you scale based on a custom metric? It's probably the one feature of k8s I appreciate the most.

On Heroku, I have written a very small autoscaling script that is called once every few minutes by Heroku Scheduler (like a cronjob). The autoscaling script pulls the custom metric, does some arithmetic, and calls the Heroku API to scale the dyno count up/down as desired. (That script was probably shorter and more readable than this comment.)

Re: Do I Need Kubernetes?

#114

Earlier quoted context omitted.

> people were amazed by the productivity gains Yeah, docker compose is great for running distributed apps locally when everything “just works”. The problem is that it also impedes development when the compose setup isn’t fully optimized. I work on dockerized rails apps, and whenever a new dependency is added, it can take 15 minutes to rebuild the image, which completely breaks my flow. Docker also creates a ton of da…

If I understood correctly, this means that every time you add a new dependency, it takes 15 minutes to rebuild the first time you `docker-compose up` right? I assume this is due to docker downloading the related image and running the container. If this is the case, isn't this orders of magnitude faster than adding the dependency manually. And aren't the gains are even more significant when we factor the fact that mos…

> this means that every time you add a new dependency, it takes 15 minutes to rebuild the first time you `docker-compose up` right?

Yes

> If this is the case, isn't this orders of magnitude faster than adding the dependency manually.

No. When developing a rails server running locally, you just need to install the new dependency via bundle install (usually takes just a few seconds) and then your server is ready to run again. With docker, the image needs to be entirely rebuilt, which is a much slower process, even with good caching. The difference is that docker treats the build as ephemeral and willing to be thrown away and rebuilt, as opposed to running directly, which simply augments the existing environment. It’s a much, much slower process to rebuild via docker.

Re: Do I Need Kubernetes?

#115
post #61

Earlier quoted context omitted.

> people were amazed by the productivity gains Yeah, docker compose is great for running distributed apps locally when everything “just works”. The problem is that it also impedes development when the compose setup isn’t fully optimized. I work on dockerized rails apps, and whenever a new dependency is added, it can take 15 minutes to rebuild the image, which completely breaks my flow. Docker also creates a ton of da…

Split the dockerfile into 3 parts. builder image for gems. builder image for assets(nodejs and stuff). copy code from disk, gems from image one, assets from image two, into the third image. you will end up saving HUGE time

Thanks, I’m gonna try this.

Re: Do I Need Kubernetes?

#116
post #61

Earlier quoted context omitted.

> people were amazed by the productivity gains Yeah, docker compose is great for running distributed apps locally when everything “just works”. The problem is that it also impedes development when the compose setup isn’t fully optimized. I work on dockerized rails apps, and whenever a new dependency is added, it can take 15 minutes to rebuild the image, which completely breaks my flow. Docker also creates a ton of da…

Split the dockerfile into 3 parts. builder image for gems. builder image for assets(nodejs and stuff). copy code from disk, gems from image one, assets from image two, into the third image. you will end up saving HUGE time

Do you have an open source Dockerfile that demonstrates this pattern? I've used builder images before, but not multiple.

Re: Do I Need Kubernetes?

#117
post #6

> Run your applications in Docker from day 1 (with docker-compose it’s as valuable for dev as it is for production) and think carefully before letting your applications store local state. I think this is the key take away for many startups. Get it so you: 1. Have a single-command way to bring up your entire backend 2. That command can run on your dev machine 3. You document all of the settings for your containers and…

> people were amazed by the productivity gains Yeah, docker compose is great for running distributed apps locally when everything “just works”. The problem is that it also impedes development when the compose setup isn’t fully optimized. I work on dockerized rails apps, and whenever a new dependency is added, it can take 15 minutes to rebuild the image, which completely breaks my flow. Docker also creates a ton of da…

You can also skip the docker rebuild and map in the build directory from your host system as bind volume instead.

Re: Do I Need Kubernetes?

#118

Vendor lock-in aside, I've found ECS to be a great alternative.

Yes if you are on AWS. Significantly speeds up the engineering workflow.

Not sure if it is a vendor lock-in. If a customer wanted to move from ECS to kubernetes, they will need to migrate the manifests, roles/rolebinding etc. That is a small effort as long as they do not have to rewrite the code.

Re: Do I Need Kubernetes?

#119
post #103
post #9

Earlier quoted context omitted.

Can I ask people who _don't_ use Kubernetes and maybe have architectures built on proprietary cloud services: how do you manage this?

Ask every enterprise that existed prior to 2018? Even for small and mid-size enterprises, manual deploys aren't that huge of a deal. Automation with some bash scripts can get you pretty far. Especially if you're only managing a monolith or two. I've worked in some platforms that absolutely defied automation due to their proprietary nature. It just meant that we'd need a few people to spend 1-2 hours every two weeks t…

To be clear, I was more asking how people achieve the sort of fast bootstrapped dev environments the parent comment describes using k8s, especially where you’re not necessarily talking about simple topologies like a monolith plus a database.

Re: Do I Need Kubernetes?

#120
post #61

Earlier quoted context omitted.

Split the dockerfile into 3 parts. builder image for gems. builder image for assets(nodejs and stuff). copy code from disk, gems from image one, assets from image two, into the third image. you will end up saving HUGE time

Do you have an open source Dockerfile that demonstrates this pattern? I've used builder images before, but not multiple.

The relevant search term is "base image"

Just remember to have a process to rebuild your base image at least once a month so you pick up latest security fixes etc.

Post reply on HN