Live data from Hacker News

Common mistakes using Kubernetes

blog.pipetail.io

121–130 of 149 posts

Re: Common mistakes using Kubernetes

#121
post #96

Well, nobody asked me, and I'm no expert, but here's my list of what (not) to do in Kubernetes (if I had the authority). 1. There. Is. No. Machine. (Insert matrix meme here.) Before you open up your cluster to the rest of company, drill it down to them. Maybe even create a Google Form where they have to sign "I hereby acknowledge that there is no machine in k8s and any attempt to tie my job to a particular machine me…

4. Centralized logging is the basics in any company. A container simply logs to stdout (kubernetes) and a fluentd/logstash agent can forward it.

7. Sadly if existing software can't run in kubernetes, this severely limit the benefits of having kubernetes, why use something that can't be used? If the jobs already have service discovery, they might be better off running on hostNetwork or whatever allow them to work as is.

Re: Common mistakes using Kubernetes

#122

In my opinion, the most common mistake is not in the article : using kubernetes when you don't need to. Kubernetes has a lot of pros or the papers but in practice it's not worth it for most small and medium companies.

Most of the time you don't even need a cluster of any kind. We live in a world where you can spin up a server with 3TB of RAM and 128 cores whenever you want, and it will cost you less than a senior developer.

https://aws.amazon.com/ec2/pricing/on-demand/

x1e.16xlarge, 64 CPU, 2TB of RAM, $10k per month.

Re: Common mistakes using Kubernetes

#123

Earlier quoted context omitted.

> Let's say you go to get a surgery. Shouldn't that be more like "Let's say you're learning to be a surgeon."? For that situation, the person they're learning from discussing problems they hit and how they solved them does sound like it would be very useful.

> Shouldn't that be more like "Let's say you're learning to be a surgeon."? No. It is an exaggerated example, because I am illustrating a psychological effect. The point is that you are consulting an expert, and you don't want that expert to tell you about all their mistakes, because your mind is now occupied with doubting that expert. It's not rational . > For that situation, the person they're learning from discuss…

A patient is not consulting an expert. A medical student is. Who would be very keen to hear some war stories.

Re: Common mistakes using Kubernetes

#124
post #41

Great post! If you're in the Kubernetes space for long enough, you'll see all of these configuration mistakes happening over and over again. I've created a static code analyzer for Kubernetes objects, called kube-score, that can identify and prevent many of these issues. It checks for resource limits, probes, podAntiAffinities and much more. 1: https://github.com/zegl/kube-score

Excellent tool. Can this analyse the result from kustomize files rather than actual k8s YAML?

Re: Common mistakes using Kubernetes

#125

Earlier quoted context omitted.

Do you also include managed kubernetes offerings, such as from Digital Ocean, in that assessment?

Honestly my experience has been that managed k8s is often more complicated from a developer perspective than just k8s - sure, you don't have to deal with setting it up, but you have to figure out how all the 'management' and provider-specific features work, and they often seem pretty clumsily integrated.

I really wish cloud providers would offer a managed Docker Swarm service - it's so much simpler than k8s, but not having to manage the underlying machines would be great.

I might be remembering wrongly, but I think Azure actually used to offer multiple managed orchestration platforms, including DCOS and Swarm, before they went all-in on k8s.

Re: Common mistakes using Kubernetes

#126
post #13

I wish there was a way to upvote something 10x once a month here. This would be the post I use that on. When I was writing my book my editor asked me to remove any writing about mistakes and changes I made in the project for each chapter. I had a bug that appeared and I wanted to write about how I determined that and fixed it. They said the reader wants to see an expert talking, as if experts never make mistakes or n…

> asked me to remove any writing about mistakes and changes I made in the project for each chapter. I had a bug that appeared and I wanted to write about how I determined that and fixed it.

Your editor is right. Not because this information is not interesting.

But it is distracting and off-topic to go off a tangent every now and then. Especially for someone just learning the stuff, it will confuse them more than anything else.

Re: Common mistakes using Kubernetes

#127

Earlier quoted context omitted.

> Let's say you go to get a surgery. Shouldn't that be more like "Let's say you're learning to be a surgeon."? For that situation, the person they're learning from discussing problems they hit and how they solved them does sound like it would be very useful.

> Shouldn't that be more like "Let's say you're learning to be a surgeon."? No. It is an exaggerated example, because I am illustrating a psychological effect. The point is that you are consulting an expert, and you don't want that expert to tell you about all their mistakes, because your mind is now occupied with doubting that expert. It's not rational . > For that situation, the person they're learning from discuss…

>The point is that you are consulting an expert, and you don't want that expert to tell you about all their mistakes, because your mind is now occupied with doubting that expert. It's not rational.

Sometimes books are written for entry level people (to the technology or topic) and they're written in an authoritative tone. But I work with people who write books. And I read their books. I don't read them like some kind of expert oracle distributing the blessed texts. I read them as a work of documentation from a friend or colleague, so I don't really feel this veneer of expertise is necessary.

Sometimes the experts try hard to scrape away the veneer of expertise by adding side fluff like in Learn you a Haskell for Great Good. Or, Alex Crichton, who is undoubtedly an expert in Rust and compiler technology giving this talk where he keeps saying things like "it does a process called quasiquoting which doesn't make any sense to me", "I don't know what hygiene means"

https://www.youtube.com/watch?v=g4SYTOc8fL0

Re: Common mistakes using Kubernetes

#128
post #71

Earlier quoted context omitted.

>They said the reader wants to see an expert talking, as if experts never make mistakes or need to shift from one tact to another. Your editor was very fucking wrong.

Obviously, I agree with you! I also think this is the way the majority of tech books are written. Can you think of another where the author goes from mistake to mistake and then finally gets it right? I believe there is a space in tech writing for this kind of writing, but it is not something traditional book publishers believe. This was an O'Reilly book by the way, with really good editors and a really good editoral…

Ignition! A history of liquid rocket propellants.

Little Lisper, Little Scheme is a conversation style that discusses a lot of false starts.

{Coders|Founders} at Work has a lot of frank talk about early mistakes people make and their pivots.

Re: Common mistakes using Kubernetes

#129
post #41

Great post! If you're in the Kubernetes space for long enough, you'll see all of these configuration mistakes happening over and over again. I've created a static code analyzer for Kubernetes objects, called kube-score, that can identify and prevent many of these issues. It checks for resource limits, probes, podAntiAffinities and much more. 1: https://github.com/zegl/kube-score

Excellent tool. Can this analyse the result from kustomize files rather than actual k8s YAML?

Yes, kustomize is not supported natively, but you can achieve effect by piping the kustomize output to kube-score.

    kustomize build | kube-score score -

Re: Common mistakes using Kubernetes

#130
post #129

Earlier quoted context omitted.

Excellent tool. Can this analyse the result from kustomize files rather than actual k8s YAML?

Yes, kustomize is not supported natively, but you can achieve effect by piping the kustomize output to kube-score. kustomize build | kube-score score -

Thanks. One more question. For Visual Studio Code, Microsoft has a plugin called Kubernetes - which I currently use. Have you done a comparison against that?
Post reply on HN