News for hackers. Stuff that matters.
Re:Why Does Developing on Kubernetes Suck? by arpa on Friday August 23, 2019 @02:27AM (#20774983)
Ok, wow. Talk about mixed feelings towards the article... the author is clearly knowledgeable, but it is so unclear why in the world does he opt for this kind of torture.

1. Why kubernetes for development? For most cases you don't need the whole orchestration over multiple nodes overhead, docker-compose is just fine. Incidentally, your push/pull problem is solved as you pull the dependencies and BUILD your app locally.

2. Want to have someplace to test your kube configurations? That's the ops part of devops. Set up a proper testing cluster instead of trying to cram everything in your devenv. Kube config should be in a separate project anyways.

3. No strace/bash. Look, man, this isn't even kubes' problem. That's how you build your images. Have separate dev images that use prod image as a base. Deploy dev images to testing env. Prod images to staging/prod. Build dev images locally.

4. Network debugging. That's difficult on any system. If you don't have access to the underlying host, you are screwed either way - call your devops for support. Anything else (internal ips, svc endpoints, ingresses) is trivial to debug on kube. However, we're talking about development... just don't use kube for development, period. Use docker-compose. Which, actually solves all your problems... right tools for the right job, or suffer the self-inflicted consequences.

Re:Why Does Developing on Kubernetes Suck? by cbanek on Friday August 23, 2019 @02:42AM (#20775036)
I agree with you that many of these are self inflicted problems. I particularly like your answer to #3, which I think I'm going to have to start adopting!

One part that I agree with the author is that local kubernetes clusters or even bare metal clusters are hard. I love being able to just spin up a cluster in GKE and have it just work. It really does just work, especially for ingress and storage. Get one piece working at a time, then you can move it to its final location and do whatever else needs to happen to make that work. It's valuable to have it working in the cloud even if prod is not, since that makes for easier testing/CI.

As for your #4, it is hard, although I've seen some success with running a pod that has tcpdump in it as a sidecar. Example here: https://medium.com/@xxradar/how-to-tcpdump-effectively-in-ku... (haven't used these directions personally, but it looks very similar to what I've seen). Some networking problems will only happen in kubernetes, things like timeout configuration and nginx stuff will just be different, so it's good to be able to do this.

One other note is for logs, just use the helm charts to install kibana/fluentd/elasticsearch into your cluster. It's really easy, and then you don't have to worry about which pod is making the logs, and by default it is tagged with the pod name and other k8s metadata.

Re:Why Does Developing on Kubernetes Suck? by merb on Friday August 23, 2019 @08:05AM (#20776612)
> that local kubernetes clusters or even bare metal clusters are hard

what's so hard about k3s, kubespray or minikube? the only problem k8s has, that without a linux dev machine you are going through the vm pain. but anything else is just simple.

btw. using mac sucks when trying to develop with local k8s. windows is better/okish, but it's best to run directly on linux.

Re:Why Does Developing on Kubernetes Suck? by cassianoleal on Friday August 23, 2019 @09:01AM (#20777035)
Why is it worse on the mac than on Windows? Legit question here, I haven't run Windows in many years so wouldn't know.

I find developing on k8s on the mac just fine. Most of the time I either just run the Docker for Desktop k8s feature, or fire up a kind cluster.

kind fits really well with VS Code's Remote - Containers extension for a completely isolated, all batteries included dev experience.

Re:Why Does Developing on Kubernetes Suck? by pacala on Sunday August 25, 2019 @07:37PM (#20796389)
Year old experience: minikube requires root if you want to run directly on the host, without a VM layer. Every couple of months it goes into a borked state, which is nigh impossible to debug and sometimes hard to recreate from scratch, possibly due to the root issue above. Got a little luckier with Ubuntu and microk8.
Re:Why Does Developing on Kubernetes Suck? by arpa on Friday August 23, 2019 @04:14AM (#20775457)
thank you. As for #4, i've heard good things about https://istio.io - supposedly it does provide nice means to gain introspection to the traffic between services.
Re:Why Does Developing on Kubernetes Suck? by echelon on Friday August 23, 2019 @02:40AM (#20775029)
> 1. Why kubernetes for development? For most cases you don't need the whole orchestration over multiple nodes overhead, docker-compose is just fine. Incidentally, your push/pull problem is solved as you pull the dependencies and BUILD your app locally.

Then it's not hermetic and repeatable. We strive for reproducibility between envs, because it reduces the chance that we're relying on incorrect assumptions about environmental behaviors.

> 2. Want to have someplace to test your kube configurations? That's the ops part of devops. Set up a proper testing cluster instead of trying to cram everything in your devenv. Kube config should be in a separate project anyways.

Is your test env just for you, or is there a chance you could break other engineers? What if they need to leverage the services your team provides in order to test what they're building, but your services are currently broken as a result of your own testing?

Develop in development. Keep staging/test accessible for tests that are minimally intrusive.

> 3. No strace/bash. Look, man, this isn't even kubes' problem. That's how you build your images. Have separate dev images that use prod image as a base. Deploy dev images to staging env. Build dev images locally.

I agree, but it still sucks. We need to get better at this. There should be a means of injecting tooling. Or having it sit on an outer layer only privileged users can execute. But then you also don't want to ship those bytes... It's a problem.

> 4. Network debugging. That's difficult on any system. If you don't have access to the underlying host, you are screwed either way - call your devops for support. Anything else (internal ips, svc endpoints, ingresses) is trivial to debug on kube. However, we're talking about development... just don't use kube for development, period. Use docker-compose. Which, actually solves all your problems... right tools for the right job, or suffer the self-inflicted consequences.

It's dangerous to get away from a real production config. It's easy to work yourself into a world where things don't work the same. Prod could talk over abstract sockets to an envoy control plane with additional smarts for retry or forwarding behavior, and you might miss some of this behavior in development if you swapped out grpc ingress.

Re:Why Does Developing on Kubernetes Suck? by pojzon on Friday August 23, 2019 @03:04AM (#20775132)
I think your team is missing a real testing pipeline that validates your changes against a production-like config on a test-kube..

Like someone higher said:

Develop using a docker-compose, when you think you are done -> run a test pipeline with your versions. That pipeline should be able to validate whether you did not break anything.

Dev_Ops means you do both but doesnt exactly mean you have to do both at the same time..

Most of the issues author described were rether self-imposed.

Re:Why Does Developing on Kubernetes Suck? by arpa on Friday August 23, 2019 @04:11AM (#20775442)
> Then it's not hermetic and repeatable.

in my experience, the core difference between local env and production in kubernetes is configuration of baremetal nodes and the firewall between them. In essence, if your docker-compose does not cover the logical equivalent of your cluster... well, you have architecture problems, and you should probably not solve them just by throwing kubernetes at it. Either that, or, covering your next point

> Is your test env just for you, or is there a chance you could break other engineers?

if your system requires significantly more resources or for some other reason you just can not bring the whole system up via docker-compose and you just really need to have a staging-level-thing-in-development, build a separate cluster for development. Leverage kubernetes namespaces so that each developer could have his/her own little namespace-sandbox-kube. I've seen that working pretty well in practice.

> There should be a means of injecting tooling

i agree that https://github.com/kubernetes/kubernetes/issues/30656 should have been closed long ago, but, again, this is not something kube should (or could) solve. Consider the simple example of your base images - one is using alpine, the other - debian. Injecting tooling is very different on these two. This could be in theory solved by injecting statically-linked executables, but, boy, this is another can of worms i'd rather leave in the hands of end-users...

> It's dangerous to get away from a real production config.

you will get away from a real production config. Your actual cluster nodes have a different configuration already. And, in my experience, that is more of an issue regarding network than additional ingress smarts. And, again, you can run a local version of the ingress as well if you need to replicate its' behavior (ingress is usually just managed nginx anyway, if you're not into exotics like Kong)... And if your control planes' smarts are undocumented and really require a full blown grpc-ingress with all the bells and whistles that kube brings, well... something's rotten in Denmark then...

Re:Why Does Developing on Kubernetes Suck? by dragonsh on Friday August 23, 2019 @04:20AM (#20775486)
1. Kubernetes is when your service needs google kind of load which 90% of systems don't. Just trade it for simple VM or use LXD containers. Don't jump on next hype cycle. If something works for Google does not mean will work for you.

2. Don't spend too much on it just use traditional knowledge and, you can still use bare-metal, VM or LXD container. Focus on application not on programming a tool designed to solve problems for Google size deployment.

3. Kubernetes is a completely different way of doing things. So if you want to leverage old cluster and distributed system knowledge you can use VM or LXD containers. Kubernetes is an overkill.

4. Abandon kubernetes instead of complaining, just use simple systems.

Re:Why Does Developing on Kubernetes Suck? by OJFord on Friday August 23, 2019 @05:27AM (#20775784)
> Kubernetes is when your service needs google kind of load which 90% of systems don't.

This is the most frustrating but oft repeated nonsense about k8s.

Kubernetes is an amazingly helpful abstraction for any amount of load on any larger than trivially tiny set of services/storage/etc.

When you, like 90% of systems, don't have Google kind of load, you don't need Google number of nodes.

Machine count corresponds to load; abstraction doesn't.

Re:Why Does Developing on Kubernetes Suck? by yongjik on Friday August 23, 2019 @12:07PM (#20779000)
Kubernetes may be a useful framework, but "amazingly helpful" is not a word I'd use for it. To me, it's a half-assed collection of five hundred nearly identical (but all slightly different) yaml files masquerading as "abstraction". And because they're yaml you can't refactor out the common part.

Well, to be fair, yaml itself doesn't exactly have a stellar reputation, but I've never seen fifty lines of yaml that could convey so little information in any other place.

Re:Why Does Developing on Kubernetes Suck? by OJFord on Friday August 23, 2019 @03:45PM (#20781817)
Use a Helm chart (or alternative)?

When you're writing YAML you can absolutely include from elsewhere (it calls it 'aliases', which is... Well, at least it exists) in multuple places - though annoyingly not from other files.

When you're reading (partially) generated YAML, (e.g. kubectl describe or edit) it's IMO a feature that everything is in its place with no indirection. (And as far as I'm aware this is YAML, not kubectl.)

Re:Why Does Developing on Kubernetes Suck? by dragonsh on Friday August 23, 2019 @06:47AM (#20776192)
> Machine count corresponds to load; abstraction doesn't.

K8s is developed to manage large number of service nodes running docker or oci containers coming from Google borg project. So it was designed for managing google level of service loads. It doesn't help when a service is only for few million users with few hundred or thousand containers. LXD and traditional tools can already do it without learning new way with lots of moving parts.

Re:Why Does Developing on Kubernetes Suck? by tutfbhuf on Friday August 23, 2019 @07:25AM (#20776364)
> It doesn't help when a service is only for few million users with few hundred or thousand containers.

Well my company switched from VMs to k8s (few hundred containers) and it helped. Proof me wrong.

Re:Why Does Developing on Kubernetes Suck? by zsoltk on Friday August 23, 2019 @08:11AM (#20776662)
My company switched from VMs to a managed k8s cluster (gcloud). It made everything harder, the application became about 5x slower and instead of a $300 monthly bill we paid for the VMs now we pay $1300.

So in summary:

* we still have same amount of developers

* we still need same amount of sysadmins

* we introduced more complexity

* the application became slower

* the whole thing became much more expensive (managed k8s price, education, consulting, etc.)

* but! we have the same amount of income every month. Surprisingly our users don't pay more for the same service because we run our stuff on k8s

Re:Why Does Developing on Kubernetes Suck? by dragonsh on Friday August 23, 2019 @10:24AM (#20777949)
Cannot comment on it unless see it in details that adding additional moving components of k8s helped.
Re:Why Does Developing on Kubernetes Suck? by oblio on Friday August 23, 2019 @07:44AM (#20776470)
Do you manage Kubernetes, personally? Did you manage the VMs?
Re:Why Does Developing on Kubernetes Suck? by tutfbhuf on Friday August 23, 2019 @08:05AM (#20776609)
Yes, i'm a DevOps engineer. I have to say, we use the Google Cloud and many Google Services, this makes live so much easier. Before that we managed everything ourselves on bare metal with debian VMs.
Re:Why Does Developing on Kubernetes Suck? by oblio on Friday August 23, 2019 @08:27AM (#20776779)
Not exactly my point. Are you comparing managing bare metal VMs with using a managed Kubernetes cluster? That's hardly a fair comparison.
Re:Why Does Developing on Kubernetes Suck? by oblio on Friday August 23, 2019 @07:44AM (#20776479)
> Kubernetes is an amazingly helpful abstraction for any amount of load on any larger than trivially tiny set of services/storage/etc.

Abstractions have a cost. You either pay the cloud provider or you pay the Ops team that runs the cluster.

If you're fine with that and have evaluated the costs correctly, great!

Re:Why Does Developing on Kubernetes Suck? by atombender on Friday August 23, 2019 @02:55PM (#20781208)
This meme needs to die. Kubernetes is not overkill for non-Google workloads.

In my current work, we run several Kubernetes clusters via GKE on Google Cloud Platform. We're a tiny company — less than 20 nodes running web apps, microservices and search engines — but we're benefiting hugely from the operational simplicity of Kubernetes. Much, much, much better than the old fleet of Puppet-managed VMs we used to run. Having surveyed the competition (Docker Swarm, Mesos/Marathon, Rancher, Nomad, LXD, etc.), I'm also confident that Kubernetes was the right choice.

Kubernetes may be a large and complex project, but the problem it solves is also complex. Its higher-level cluster primitives are vastly better adapted to modern operations than the "simple" Unix model of daemons and SSH and what not. The attraction isn't just the encapsulation that comes with containers, but the platform that virtualizes physical nodes and allows containers to be treated as ephemeral workloads, along with supporting primitives like persistent volumes, services, ingresses and secrets, and declarative rules like horizontal autoscalers and disruption budgets. Given this platform, you have a "serverless"-like magically scaling machine full of tools at your fingertips. You don't need a huge workload to benefit from that.

As for LXD and the other alternatives, these might be great, but Kubernetes has vastly more mainstream adoption these days. That's more important than mere technological superiority, or everyone would be using OpenSolaris with Zones and ZFS these days.

Re:Why Does Developing on Kubernetes Suck? by te_chris on Friday August 23, 2019 @05:13AM (#20775731)
This misses the genius of k8s. When you adopt it, you’re adopting a completely declarative way of provisioning your system. It’s a total paradigm shift and I will never go back. My big want, is a kube as a service for small workloads - I.e I can just apply a deployment and everything goes up, no cluster considerations or whatever.
Re:Why Does Developing on Kubernetes Suck? by dragonsh on Friday August 23, 2019 @05:31AM (#20775795)
It's good if you found it working for you. If your team can grok over all of k8s complexity and moving parts, stick with it, use the tools your team is comfortable with. I tried working with docker since 2013 and later with Kubernetes, I still go back to LXD. In my view less systems and moving parts less complexity, maintenance and cognitive load. On top of it I don't have to give up decades of knowledge I learned regarding cluster and distributed computing on bare-metal and VM as I can apply the same to LXD. Obviously I can do that with Kata containers, but they didn't fit with my team either. Also for most of services with users in the range of 160-180 million LXD work fine.
Re:Why Does Developing on Kubernetes Suck? by nouney on Friday August 23, 2019 @04:29AM (#20775535)
Managing a VM vs a managed Kubernetes cluster? I'd choose kubernetes without hesitating
Re:Why Does Developing on Kubernetes Suck? by dragonsh on Friday August 23, 2019 @05:22AM (#20775762)
Don't manage VM, try LXD containers [1], they are containers with much better security and you can still use the same tools you learned for last decade or two to manage including the DSL if you like that.

Kubernetes is an Overkill for majority of development and production systems.

[1] https://linuxcontainers.org/

Re:Why Does Developing on Kubernetes Suck? by oblio on Friday August 23, 2019 @07:45AM (#20776484)
> Managing a VM vs a managed Kubernetes cluster?

So the win is not having to manage something :-) How is that a fair comparison?

Re:Why Does Developing on Kubernetes Suck? by ninkendo on Friday August 23, 2019 @11:46AM (#20778785)
> So the win is not having to manage something

Exactly!

> How is that a fair comparison?

Not only is it a fair comparison, but I'd say it's the entire raison d'etre of using any orchestration platform: You get to farm out bits of the infrastructure to others. Getting on k8s enables you to not have to run your own infrastructure, whereas having VMs being your abstraction sorta by definition does not.

Re:Why Does Developing on Kubernetes Suck? by arpa on Friday August 23, 2019 @04:24AM (#20775509)
for development, i agree. For production/testing/staging - hmmmm, it depends. I have taken a particular liking to the self-healing/HA properties of kubernetes. You just swap the dead nodes out without significant impact on the production... it's awesome.
Re:Why Does Developing on Kubernetes Suck? by sametmax on Friday August 23, 2019 @05:11AM (#20775727)
The trick is to understand that most products don't need to have 99% uptime. Your business will be fine if you are offline once in a while.

Hell, the stock market goes offline every night.

Those last % of uptime are very, very expensive at every level (money, people, logistic...). They better be worth it.

Re:Why Does Developing on Kubernetes Suck? by tinco on Friday August 23, 2019 @06:11AM (#20776007)
There's a difference between going offline at a set time for a set amount of time, and going offline randomly for unpredictable amounts of time.

HA is not just about getting that sixth 9, it's also about the peace of mind that you are insulated from a range of problems. Not only would I not worry about our SQL service going down, I also don't have to worry about what I have to do when a node goes down, because that's automated.

Re:Why Does Developing on Kubernetes Suck? by sametmax on Friday August 23, 2019 @07:48AM (#20776502)
Even an occasional site crash is ok. I'm not saying it's a good user xp, and avoiding it is both better for the tech team and the marketting one.

But the cost of a 500 is always to be balanced with the cost of going full throttle with micro services.

As perfectionists, it's easy to fall into the trap of choosing the later by default.

Re:Why Does Developing on Kubernetes Suck? by tinco on Friday August 23, 2019 @09:34AM (#20777398)
What do micro services have to do with it? If anything, HA is harder to achieve with microservices. There's all these weird false dichotomies going around in this thread.
Re:Why Does Developing on Kubernetes Suck? by ninkendo on Friday August 23, 2019 @11:48AM (#20778814)
Exactly... HA is about being able to sleep more peacefully each night.
Re:Why Does Developing on Kubernetes Suck? by arkh on Friday August 23, 2019 @04:31AM (#20775544)
> docker-compose is just fine

Not when part of your dev use macOS and another part uses linux: gotta love how docker manages file permissions between host and containers.

Re:Why Does Developing on Kubernetes Suck? by arpa on Friday August 23, 2019 @04:38AM (#20775580)
docker on mac is a pain either way, since it sits in a linux vm and talks to mac fs via nfs. And as for permissions... well, it's been pretty much covered long time now - e.g. https://www.berthon.eu/2018/containers-volumes-and-file-perm...

hope this makes your life a bit easier.