The amount of vitriol in this comments section is astonishing. Can we not share fun projects without the professional Kubernetes experts thumbing their noses? At the very least, it does seem now like the complexity of K8s’s code base is a point of very thin skin for the community.
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.<p>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.<p>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.<p>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.<p>I suspect it is simpler than Kubernetes, but I don't think it's a clear cut case.
> simple<p>> 17k lines of shell script<p>those two phrases don't belong together... to think about this, "17k lines" and "shell script" should not be used together either.<p>Also, you are a bit light on tests.. there only seems to be a single trivial one, which seems way too low for a codebase this size.
Building a platform to deploy stateless services are the easy part. This might even work nicely at a smaller scale. It is gets super complicated when you want to mount volumes, re-use those volumes. This is like a nice weekend project, contrarian in nature, but it is just not a replacement for kubernetes. This is some bash script orchestration on top of podman.<p>Bulk of complexity in opensource distro of kubernetes comes from the fact that everything is interface driven and has to work in an generic way. For example, you don't really have to implement cri-o like thing if you are opinionated platform and only supports docker. Similarly, you don't have to build CSI, if you only support ceph or aws' storage. I love the contrarian thought, but matter of the fact is modern orchestration platforms that want to be a general purpose platform is going to be big.<p>It is a really nice exercise however build something like this when you want to learn about networking, containers, orchestration, storage etc. and how to tied everything together.
This is my kind of tom foolery. Love it. You should come work with me at Heroku: <a href="https://www.heroku.com/careers/software-engineer-heroku-runtime-infrastructure-102" rel="nofollow">https://www.heroku.com/careers/software-engineer-heroku-runt...</a>
Kubernetes might follow the sad path of spring.<p>Perfect, complete and too complex.<p>For big and great applications, spring if the obvious choice. It makes incredible complex and difficult things easy.<p>But, unfortunately, makes simple and quick applications incredible complex and difficult.
i love this, and especially love how there are only a few things in the world that one could reasonably claim to simplify with "17k lines of shell script", and one of those is kubernetes. hilarious! (and i even see the value beyond the mere humor of the project's existence, which for me (and unlike all these salty k8s stan commenters*) would be <i>more</i> than enough justification on its own for creating the project in the first place). it's like both a useful project and performance art!<p>* for the umpteenth time i daresay that hn needs to grow a sense of humor sometimes...
17k lines is a lot of shell... but... it bypasses all the complexity of heavyweight scripting languages, bash is a lightweight interpreter that is always there and just works and i bet it's fast.<p>this is a cool idea.<p>next up, somebody will modernize daemontools for the container/cluster era...
If you're looking for a simple Kubernetes alternative, take a look at the HasiCorp stack. I use that in production and it's easy to set up and maintain.
1. Anything that offers effective competition to Kubernetes is a Good Thing. I'm not saying this is because I haven't look at it closely enough but competition brings about improvement.<p>2. Why do people write "Simplenetes has a 100x less code than Kubernetes" instead of saying it has 1/100th the code?
I’m not sure if rewriting applications in bash should be considered an improvement...
<a href="https://twitter.com/astarasikov/status/568825996532707330?s=21" rel="nofollow">https://twitter.com/astarasikov/status/568825996532707330?s=...</a>
Unsolicited review of sync.sh ahoy!<p>The easy stuff:<p>- Non-exported variables are by convention lower_case, while exported variables are UPPER_CASE.<p>- Function names are by convention lower_case.<p>- There's a "quite" signature string and variable; should it be "quiet"?<p>- The lines like `local hosts=` can be simplified as `local hosts`. You can also join such lines, as with `export`, into `local foo bar baz …`.<p>- `[[` is generally considered more reliable than `[` (there are a bunch of posts about this on Stack Overflow and Unix Stack Exchange).<p>- Naming scripts .bash rather than .sh lets `shellcheck` inspect them without telling it which shell to verify against. You do check these files using `shellcheck`, right?<p>- Variable names like `list` and `tuple` are unhelpful; what do they actually contain? Also, they should probably be actual arrays rather than a space-separated string to avoid relying on word splitting, and to allow entries with whitespace in them.<p>The scary stuff:<p>- All the string packing and unpacking also makes me nervous. That's not simpler than using JSON/YAML, it's just a different kind of complexity.<p>- Reusing the same variable a bunch of times in the same function makes it really easy to end up with the wrong value at some point. Better to split stuff into more functions or rename the variables to make them single use.<p>- `set -o errexit -o pipefail` would be good to have for safety.<p>- `kill -9` anything[1]<p>- Why are some of the variables inside functions not local? They effectively end up being globals, which makes for really difficult debugging.<p>The good stuff:<p>- Using local variables everywhere.<p>- Descriptive error messages.<p>- Returning early in case of errors.<p>All in all, Bash is not a good language for any system of this size, no matter how diligently you program. The error handling isn't comparable to most mainstream languages, the data types are incredibly limited, and there's no native support of recursive languages like JSON. You've done a great job, but I'm afraid a system like this is doomed to failure from these facts alone.<p><pre><code> [1] https://mywiki.wooledge.org/ProcessManagement#I.27m_trying_to_kill_-9_my_job_but_blah_blah_blah...</code></pre>
Wait, he writes insane shell scripts, and his Twitter handle is BASH-lund?<p>I'm in love! <3 :-D<p>Related: Bocker, Docker rewritten in 100 lines of Bash <a href="https://github.com/p8952/bocker" rel="nofollow">https://github.com/p8952/bocker</a>
No Persistent Volume support, so not great for stateful applications. Claims that type of thing is "magic", and therefore out of scope.<p>Quite an engineering feat, though, I am sure! Is this to have fun, to learn, to actually use in production?
Im personally not ever gonna use it as long as docker swarm is maintained.<p>But thank you for bringing the world another tiny step closer to abandoning k8s and k8s (over-engineering) mentality.<p>You’re doing so much for the world and for all the developers. Thank you!
This has been bugging me for a while. Programmers <i>love</i> to reinvent the wheel. There a millions of make(1) clones, key-value stores, etc but I don't seem to see many projects (even toys) in the "declarative container runners" space. I think it's a shame.<p>While Kubernetes is hopefully Very Good, it is complicated, and I have often wondered what other approaches would yield (e.g. more imperative ones, because writing admission controllers is not exactly easy). So I'm glad to see people playing around, though I don't know if this amount of bash is healthy or if 17,000 lines is simple.
At some point, April Fools jokes ceased being funny.<p>Now I’m trying to figure out if I just got too old to appreciate them, or if the good ones have all been used up.
17k lines of shell? Hah give me the infinity lines of Go that is kubernetes — maintaining shell scripts is a nightmare. At least Go is a proper language with an ecosystem and tests and established best practices, etc., etc.<p>Also namespaces are a killer feature of K8s imo
I don’t care about Kubernetes, but someone might read this post and decide that it is a good idea to “simplify” an existing project by rewriting it in 17000 lines bash script.<p>And some hapless person will be stuck maintaining and debugging it. It could be me, or you, your friend. You don’t want this to happen.