Take a look at Nomad before jumping on Kubernetes
atodorov.me
atodorov.me
Looking at it from the consumer side and comparing like to like I don't feel its a _lot_ simpler. Task groups and pods, tasks and containers, config, networking, storage, it is all different on nomad but not, imo, tremendously simpler. That makes sense given the nature of the problem the systems are addressing. Over the last five years kubernetes has grown horizontally a great deal to encompass more and more enterprise features and use cases, and I feel in general this is a repeating pattern: a thing is created, it works well and becomes popular, more people use it and join the community bringing their own use cases, which drives the addition of features to the thing, which eventually gets complicated enough that people are attracted to a new thing that does largely the same stuff but hasn't had a lot of the new features added yet. Rinse and repeat.
On a somewhat unrelated note: I'm not very attracted to server-side features for tracking and manipulating versions of deployments and their history. I'm a fan of git ops, and what I want out of the server-side runtime is reliable, fast reconciliation of the infrastructure state with the release branch in my repo. If I want to roll back I would much rather revert in git and redeploy. It seems troublesome and error prone to rely on a cli command to force the server side state to a previous iteration that is not in sync with what master in the repo says should be the canonical release version. Interested in others' thoughts, but maybe its a separate topic.
One reason I'd prefer to use Nomad over K8s is scalability. K8s becomes slow and occasionally acts weird with just a few thousand pods. (Not that it is particularly fast with small numbers of pods.) Nomad is known to run reliably in production with many thousands of mixed workloads, not just containers.
Another reason is its specialization. I'd rather deal with a handful of independent, well documented components (consul, vault, nomad, basically) than with one that does all things, but in a way I have to occasionally fight, and which, by necessity, given its breadth, is awfully documented. We do use k8s but still run vault for secrets - k8s secrets are a joke. We don't use consul because our discovery needs are simple, but the service abstraction in k8s is weak at best.
While I'm not a big fan of HCL, any version, either, I do think that being able to manage everything, from cluster configuration to application deployment, via the same tool (terraform), in git, is more convenient than still having to use terraform for infrastructure but being forced to use helm on top of it - you might be able to maintain applications as terraform HCL scripts, but it would be unreasonable, given that for many applications that you'll want to deploy there are readymade charts available.
From a strictly theoretical point of view, designing any kind of software the way kubernetes is designed is bad practice. It consists of very few components - but which do many different things. Some people work hard to maintain the system usable, but IMO the bad structure shows in how users need to interact with the system.
Which is why, if the choice was mine, and not hype-driven, I'd take managed nomad with consul, vault, terraform and some git repo (my choice: gitlab, because it comes with a nice integrated CI) already integrated any time over managed kubernetes. But that's just me.
Consul/Nomad deployment is easy and operation is a breeze. As the sole ops person at my company, Nomad has made it possible for me to scale our infrastructure without an entire team dedicated to it.
I'm not saying that it's better than K8S, but for a small team who wants to focus on building things, it's an amazing time saver. Obviously, read the docs and make your own decisions, but there is a definitely an infrastructure void that Nomad has filled perfectly.
I'm skeptical that anything allowing flexibility in this space can ever be that simple because the domain is actually pretty complicated. Networking, secrets, scaling, healthchecking, deployment strategies, containerization -- you need to know something about all of these before you can use Nomad or Kubernetes.
IME, a lot of complexity, in kubernetes land, also comes from kubernetes being highly opinionated. Whenever your needs don't match kubernetes' opinions, you have to fight it. To give you an example, service versioning is not something kubernetes knows about. If you need it, you need to add it manually. You can easily automate this with consul, and make applications unaware of service versions. Reciprocal trust verification between ... things that communicate is another. Kubernetes provides nothing. If someone manages to inject a pod into your namespace, and randomly starts replaying requests, there's no automatic way to verify the caller's identity - you have to do this manually, at the application level, using a custom sidecar (if you're lucky, your service mesh has something to help you). If you use consul with nomad, you get these things out of the box.
I believe your life is simple now because what you manage isn't overly complicated. Once you have thousands of distinct deployments, versioned, across several clusters, and thousands or even tens of thousands of pods running in tens of data centers, life with kubernetes becomes a lot more difficult. Of course, you can still manage, by automating everything, but automation, at that level, with kubernetes, is not an easy thing. Or at least that's my experience.
If you're doing your own bespoke ops or you need to own more of the stack, then Nomad is a powerful choice.
Is it, really? It feels like it is it's main disadvantage, in the sense that Kubernetes is a first-class citizen offered by practically all major cloud providers, while Nomad... Is anyone actually offering Nomad at all?
Nomad, on the other hand, is pretty simple and easy to run, and a single binary. There's probably no benefit to having a managed offering.
That said, I wouldn't be surprised if HashiCorp add Nomad to HashiCorp Cloud Platform, which currently lets you deploy Consul and Vault to cloud providers via their system.
Which is to say it's useful enough to a large amount of people to make it viable as a product offering. Nomad would fail as a managed offering here like like Deis, Flynn, Convox and probably 100 other container management platforms that came before.
As a niche tool to manage sub-1000 boxen it's probably ok. But k8s has won the greater war.
Disclaimer: Worked on Flynn, still run it for my own personal stuff by $DAY_JOB is all k8s.
Your enumeration of the managed things is very particular, in that it includes only stores. There's a reason for things that have keeping persistent state as their reason to exist are managed: reliably maintaining persistent state in the cloud is a lot more difficult than reliably orchestrating things that just have to run.
Managed _something_ does not mean it's "mind-bendingly complex", but rather that people don't want to take care about it and focus on their own stuff like building applications.
My actual need is that I deploy my application and I don't care where or how it is running. Most of people should not even think about running k8s on their own. That should be job of a service provider and there should be service provider for running "Nomad".
There are some specific places that k8s can shine, but easy scaling(1000 nodes +) and low management overhead isn't one of them.
The equivalent of k8s is not nomad, it's nomad+consul+vault
If you read through something like kubernetes-the-hard-way most of the really tricky parts are setting up the PKI infrastructure and bootstrapping etcd.
https://learn.hashicorp.com/tutorials/nomad/security-enable-... starts to look a lot like https://github.com/kelseyhightower/kubernetes-the-hard-way/b...
Vault is better than k8s secrets, but getting nomad working doesn't magically give you a working vault cluster.
This was my stumbling block.
Nomad alone is clearly easier than k8s, and if it alone will suit your needs then you are in luck, but I didn't find installing and configuring 3 separate services any easier than k8s alone.
You can easily write tools that generate json/yaml for you based on your needs. For most applications you're deploying you'll need:
1. A Deployment
2. A Service that points to that Deployment
3. An Ingress or similar
In some cases you'll want to manage persistent state on disk and you'll need a StatefulSet.
A good example of this can be seen https://youtu.be/keT8ixRS6Fk?t=1317 and https://youtu.be/muvU1DYrY0w?t=581
Can you with yaml? Helm tries, but isn't that great, jinja ( depending on how its done ( jinja in yaml as in ansible or jinja to yaml as in SaltStack)) does an ok job, but fundamentally managing a language which uses spaces for logic with code is hard, and certainly YAML wasn't created to be managed that way.
JSON i agree, you can easily convert your language of choice's data structures to it. But do you have to? It adds another layer of complexity, and you can have unexpected bugs ( since you have a logic layer that creates JSON, which could be wrong due to a logical error).
HCL is a DSL that needs learning and few use outside of Hashicorp products, but IMHO it's not that hard ( docs are great, tutorials are plenty) and it's worthwhile to have data+logic in the same human and machine readable layer.
In any case, Nomad accepts JSON for everything ( mostly for when non-humans interact with it).
I intend to write an OSS version of it because Jsonnet really is probably the best fit here (though Cue/Dhall are interesting I think Jsonnet is easiest to get others to adopt).
kubectl is close but doesn't understand secrets/variables, the concept of clusters, or changing image tags programmatically. It's difficult to get right.
Isn't that the problem kustomize (which kubectl now has native support for applying) is trying to solve? I ask that honestly, because I haven't used kustomize in anger in order to compare its workflow to that of helm
I need to check out kubecfg, I haven't used it yet.
Definitely agree that it's difficult to get right but the authors of the tool definitely struck a really good balance.
Hopefully if I implement it myself I can do their original design and implementation justice.
That seems a lot better than either SaltStack's use of Jinja (using text-based templating on a structured format) or Ansible's (using YAML as syntax for an imperative programming language that has Jinja-evaluation functionality).
"For machine-friendliness, Nomad can also read JSON-equivalent configurations. In general, we recommend using the HCL syntax."
https://www.nomadproject.io/docs/job-specification#job-speci...
With Kubernetes, you can even use one of the many native clients (and/or protobuf) which makes converting from something else a breeze, avoiding the JSON/YAML entirely. You get static typing, you can write tests, etc.
We've written:
* A custom task driver to launch and manage Firecracker VMs
* A device plugin for managing persistent disks
The second is interesting – we looked hard at CSI, but the complexity cost of CSI is very high. The benefit is pluggable storage providers. We don't need pluggable storage providers, though.
Likewise, we don't need pluggable networking.
Device plugins are a really nice way to extend Nomad.
K8s was definitely easier to setup.
I feel like nomad is appealing to people who don't really need orchestration but feel like they do.
It's perfectly fine to run apps with just docker. I have small projects on the side which are just a couple of servers with docker: one nginx container pointing at a few docker containers containing some services.
Once my needs grow, I'll just roll them over to k8s.
How so? I can't imagine any production setup of Kubernetes from scratch ( not managed by a cloud provider) being easier, initially or on day 2, than Nomad+Consul+Vault, but maybe i'm missing something.
- Charmed Kubernetes (Juju)
https://jaas.ai/canonical-kubernetes
- Mikrok8s
Recruitment should not be an issue since anyone who understands k8s should be able to grasp Nomad, and vice versa (although in the latter case, with much more effort).
And many years ago we used it as a feature in a product written in Go. We could just tap in to the APIs directly. It is amazing for batch jobs.
I later realised my blog and little side projects do not need a cluster but that's another story. I was mainly looking at it to learn than to properly utilize
Completely off topic, sorry. Whatever happened to Flynn.io? That was my favorite of the clustery things but it just sort of fell off the internet
e: oh. Answered by visiting the site just now. "Flynn is no longer being developed." that is a shame.
It's gotten drastically better, but updates are still serious work ( point in case, all cloud providers bar Scaleway are usually multiple versions late)
... will build deep understanding and accumulate knowledge over the years. I won't deny that you could learn Nomad fast, but becoming an expert in some domain really takes some time.
I don't entirely know if this joke matches the reality of Nomad vs K8S, but that's probably the general sentiment. Bigger usually implies harder to fix.
To be fair, this time around the ones afraid of Kubernetes are the companies trying to sell a Kubernetes competitor.
I just used Kubernetes at work, inherited a poorly maintained cluster, and when time came to change, due to very limited time available, we opted for Nomad. Few years in, i'm telling what i've learned ( while still running a k8s cluster for home use, so i'm not entirely disconnected from the k8s ecosystem)
However one of the things I jumped into the assumption that the blog post was stealth advertising for Nomad was a few exaggerated claims that feel quite a stretch to be able to come up with anything in favour of Nomad over Kubernetes.
One of them, for example, is that
Nomad is supposed to be "significantly easier than microk8s or minikube or kind" to run locally as a dev environment. Well, anyone familiar with minikube is well aware that to get it up and running you only need to install it and kubectl, and quite literally just run 'minikube start'. Nomad agent is not only far more convoluted to get up and running according to Nomad's official documentation, but it is also explicitly stated that it's use is highly discouraged. Don't you feel that you're misrepresenting Nomad's selling points?
> Nomad is supposed to be "significantly easier than microk8s or minikube or kind" to run locally as a dev environment. Well, anyone familiar with minikube is well aware that to get it up and running you only need to install it and kubectl, and quite literally just run 'minikube start'
It would appear that i wasn't up to date on minikube - last time i installed it ( it was a few years back, and since then i've switched to microk8s for local stuff), it required a VM intermediary and driver, but that's no longer the case, direct Docker being supported. That's drastically easier than it was before, but there's still a slight advantage to Nomad (see below).
> Nomad agent is not only far more convoluted to get up and running according to Nomad's official documentation, but it is also explicitly stated that it's use is highly discouraged
How so? Download a binary, run `nomad agent -dev` and that's it, there's nothing convoluted. It's highly discouraged the same way minikube is - for production use. With `nomad agent -dev` you get a local ephemeral Nomad instance you can do whatever you want with, but should never use it for production use.
The small advantage i talked about is that minikube is a separate thing you have to download ( and there's minikube vs microk8s vs kind); with nomad, it's the same one as the CLI you need to interact with the cluster. So i'd be like there was `kubectl minikube start`, and that's it - you can go from working with a cluster to having a local one for testing in a command. Very slight advantage, indeed, but still one IMHO.
My first option would be to hire a managed Kubernetes service. If that proves to be unreliable or not cost-effective in the long run, I'd then consider making this in-house and use Nomad instead.
I'm also not sure if Nomad has an equivalent of the listeners that you have on Kubernetes to implement reconciliation loops, i.e. the controller part of operators.