Hacker News new | past | comments | ask | show | jobs | submit login

This is ~17k lines of shell scripting and claims to be "simple". Kuberentes is probably ~1m lines of Go. I'm not entirely convinced that this is less complex (simpler) than Kubernetes.

There are many factors in complexity, but a big one for me is what I have to hold in my head – global state. From any given point, what do I need to understand to know what's actually going on.

For Go, this is actually comparatively little. Between a fairly straightforward language, static binaries, and the focus on ease of distribution, there's not a whole lot outside of a codebase itself to think about.

However for a shell like Bash there's a relatively large amount to consider. You're very exposed to the underlying OS, to libraries and system packages, to various tools, to configurations users may have specified, to things being redefined underneath you. There's a lot of global state to consider for a Bash script.

I suspect it is simpler than Kubernetes, but I don't think it's a clear cut case.




To be fair Kubernetes itself probably has 17k lines of bash, and it is a good thing. It is the first go-to project that I use as a reference for bash scripting best practices.

edit: wc reports 47023 lines in *.sh[1], out of which 23836 are unique[2].

[1]: find . -name '*.sh' | xargs cat | wc -l

[2]: find . -name '*.sh' | xargs cat | sort | uniq | wc -l


You might enjoy having a look at https://github.com/AlDanial/cloc

It can distinguish between actual lines of code, comments and empty lines for a lot of different languages.


You might want to look at https://github.com/boyter/scc

It's the same as cloc, but ludicrously fast.


Thanks for sharing - I've been using cloc whenever needed but scc looks like a really sweet alternative/improvement!


I can't believe you are being serious - why are you comparing a shell script to a million-line piece of production software? Apples to oranges. This was written as a joke to make fun of a common gripe against Kubernetes - its complexity. Seems like the Kubernetes community has a bit of a thin skin.


If it is a joke, the README does a poor job of conveying that. It is a bit funny at first but then gets relatively serious and recommends the project for use with up to 20 containers, with the beta caveat.

Either way, setting aside the laudable amount of work put into this, talking about the issues of complexity and different forms it takes seems quite on topic. (I don't have a cow in this fight, not using K8s or anything of the sort.)


the 30 million line problem;

https://caseymuratori.com/blog_0031


Go has a lot of boilerplate code - simple things take many lines, so I wouldn't be too serious about 1M


Yeah that's kinda my point. Boilerplate isn't necessarily "complex" in that way. If you can ignore it that's great.

I'm not sure you can with shell scripting because of all the global system state.


If we take out the argument of OS dependent setup, supporting only stateless services etc.

One of the key benefits of kubernetes are API server and custom resource definitions. If you don't like how kubernetes does stuff. You can change the default behavior and orchestrate the way you want.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: