<p>What does Apache Mesos do that Kubernetes can't do or vice-versa? </p>

<p>Mesos is a Two level scheduler. Sure it grabs resource information from every machine and gives it to the top level scheduler such that frameworks like kubernetes can use to schedule containers across machines but Kubernetes can itself schedule containers across machines (No need for Mesos from this regard). so what are few things that Apache Mesos can do that Kubernetes cannot do or vice-versa?</p>

<p>Both Mesos and Kubernetes are n-th level containers orchestrators. This means <strong>you can achieve the same features but some kind of tasks could be done easier</strong> (read. better) on one of them. In fact, you can run Kubernetes on Mesos and vice verse.</p>
<p>Let's go through main differences that give some clue when you need to make a decision:</p>
<h3>Architecture</h3>
<p>As you pointed out Mesos is a Two-Level Scheduler and this is the main difference in architecture. This gives you the ability to create your custom scheduler (aka framework) to run your tasks. What's more, you can have more than one scheduler. All your schedulers compete for the resources that are fairly distributed using <a href="https://cs.stanford.edu/%7Ematei/papers/2011/nsdi_drf.pdf" rel="noreferrer">Dominant Resources Fairness algorithm</a> (that could be replaced with custom <a href="http://mesos.apache.org/documentation/latest/allocation-module/" rel="noreferrer">allocator</a>). You can also assign <a href="http://mesos.apache.org/documentation/latest/roles/" rel="noreferrer">roles</a> to the frameworks and tasks and assign <a href="http://mesos.apache.org/documentation/latest/weights/" rel="noreferrer">weights</a> to this roles to prioritize some schedulers. Roles are tightly connected with <a href="http://mesos.apache.org/documentation/latest/attributes-resources/" rel="noreferrer">resources</a>. Above features gives you the ability to create your own way of scheduling for different applications (e.g., <a href="https://github.com/Netflix/Fenzo" rel="noreferrer">Fenzo</a>) with different heuristics based on a type of tasks you want to run. For example, when running batch tasks it's good to place them near data and time to start is not so important. On the other hand, running stateless services is independent of nodes and it's more critical to run them ASAP.</p>
<p><a href="https://i.stack.imgur.com/WvYZH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WvYZH.png" alt="Mesos Architecture" /></a></p>
<p>Kubernetes architecture is a single level scheduler. That means decisions where pod will be run are made in a single component. There is no such thing as resource offer. On the other hand, everything there is pluggable and built with a layered design.</p>
<p><a href="https://i.stack.imgur.com/ZZw2M.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZZw2M.png" alt="Kubernetes architecture" /></a></p>
<h3>Origin</h3>
<p>Mesos was created at Twitter (formerly at Berkeley but the first production usage was at Twitter) to support their scale.</p>
<blockquote>
<p>In March 2010, about a year into the Mesos project, Hindman and his Berkeley colleagues gave a talk at Twitter. At first, he was disappointed. Only about eight people showed up. But then Twitter's chief scientist told him that eight people was lot – about ten percent of the company's entire staff. And then, after the talk, three of those people approached him.</p>
<p>Soon, Hindman was consulting at Twitter, working hand-in-hand with those ex-Google engineers and others to expand the project. Then he joined the company as an intern. And, a year after that, he signed on as a full-time employee.
<a href="https://www.wired.com/2013/03/google-borg-twitter-mesos/" rel="noreferrer">source</a></p>
</blockquote>
<p>Kubernetes was created by Google to bring users to their cloud promising no lock-in experience. This is the same technique Amazon did with Kindle. You can read any book on it but using it with Amazon gives you the best experience. The same is true for Google. You can run Kubernetes on any cloud (public or private) but the best tooling, integration and support you'll get only on Google Cloud.</p>
<blockquote>
<p>But Google and Microsoft are different. Microsoft wants to support everything on Azure, while Google wants Kubernetes everywhere. (In a sense, Microsoft is living up to the Borg name, assimilating all orchestrators, more than Google is.) And quite literally, Kubernetes is how Google is playing up to the on-premises cloud crowd giving it differentiation from AWS (which won’t sell its infrastructure as a stack with a license, although it says VMware is its private cloud partner) and Microsoft (which still doesn’t have its Azure Stack private cloud out the door). <a href="https://www.nextplatform.com/2016/11/08/google-wants-kubernetes-rule-world/" rel="noreferrer">source</a></p>
</blockquote>
<h3>Community</h3>
<blockquote>
<p><a href="https://groups.google.com/a/dcos.io/d/msg/users/1YEfYvSyH_Y/yyShheMSCQAJ" rel="noreferrer">Judging a project simply by its community size could be misleading. It's like you'd be saying that php is a great language because it has large community.</a></p>
</blockquote>
<p>Mesos community is much smaller than Kubernetes. That's the fact. Kubernetes has financial support from many big companies including Google, Intel, Mirantis, RedHat and more while Mesos is developed mainly by Mesosphere with some support from Apple, Microsoft. Although Mesos is a mature project, its development is slow but stable. On the other hand, Kubernetes is much younger, but rapidly developed.</p>
<p><a href="https://i.stack.imgur.com/qK3oj.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qK3oj.jpg" alt="Mesos Community" /></a></p>
<p><a href="https://twitter.com/janiszt/status/878557351095226368" rel="noreferrer">Meso contributors origin</a></p>
<p><a href="https://youtu.be/cwcvAbwm-R4" rel="noreferrer">The Kubernetes Community - Ian Lewis, Developer Advocate, Google</a></p>
<h3>Scale</h3>
<p>Mesos was targeted for big customers from the early beginning. It is used at Twitter, Apple, Verizon, Yelp, Netflix to run hundreds of thousands of containers on thousands of servers.</p>
<p>Kubernetes was started by Google to give developers Google Infrastructure experience (<a href="http://gifee.cloud/" rel="noreferrer">GIFFE</a>). From the beginning, it was prepared for small scale up to hundreds of machines. This constraint is increased with every release but they started small to grow big. There are no public data about biggest Kubernetes installation.</p>
<h3>Hype</h3>
<p>Due to scale issues, Kuberntetes started to be popular among smaller companies (not cloud scale) while Mesos was targeted for enterprise users. Kubernetes is supported by Cloud Native Foundation while Mesos is Apache Foundation Project. These two foundations have different founding and sponsors. Generally, more money gives you better marketing and Kubernetes definitely did it right.</p>
<p><a href="https://i.stack.imgur.com/8KbNR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8KbNR.png" alt="Mesos vs Kubernetes" /></a></p>
<p><a href="https://g.co/trends/RUuhA" rel="noreferrer">https://g.co/trends/RUuhA</a></p>
<h3>Conclusion</h3>
<p>It looks like Kubernetes already won the containers orchestrator war. But if you have some custom workloads and really big scale, Mesos could be a good choice.</p>
<blockquote>
<p>The main difference is in the community size and the open source model : where DCOS is supported by Mesosphere and provide enterprise features in a commercial product only (because mesosphere isn't philanthropist), K8S has a larger community with strong contributions from different companies resulting in providing much more integrated enterprise features (multitenancy, RBAC, quota, preemption, gateways...) meaning they are easier to use, not necessarily they don't exist in DCOS.
I would globally say that :</p>
<ul>
<li>DCOS is more battle tested for stateful and big data workloads but lacks of integration with other perimetric components including plug and play central monitoring and logging and enterprise features like security model, multi tenancy, auto updates... It was a very hard way to integrate everything for a production grade platform.</li>
<li>K8S is more battle tested for stateless apps and provides lots of plug and play tools like prometheus, EFK, helm... which makes the implementation of a production grade platform much easier. Next to that there is a big move on stateful workloads with statefulsets and the operator pattern which is comparable with mesos frameworks but again, K8S provides lots of tools to develop them with less costs because lots of functionalities are provided out of the box, it takes me 2 months to develop a MongoDB operator to provide MongoDB as a service in a multi tenant and secured way and I needed to learn Golang in the same time.</li>
</ul>
<p><a href="https://groups.google.com/a/dcos.io/d/msg/users/1YEfYvSyH_Y/qZMJMzX3CAAJ" rel="noreferrer">source</a></p>
</blockquote>
<ul>
<li><a href="https://www.infoworld.com/article/3118345/cloud-computing/why-kubernetes-is-winning-the-container-war.html" rel="noreferrer">https://www.infoworld.com/article/3118345/cloud-computing/why-kubernetes-is-winning-the-container-war.html</a></li>
<li><a href="https://www.theregister.co.uk/2017/10/17/docker_ee_kubernetes_support" rel="noreferrer">https://www.theregister.co.uk/2017/10/17/docker_ee_kubernetes_support</a></li>
<li><a href="https://www.techrepublic.com/article/these-two-vendors-are-most-likely-to-bring-kubernetes-containers-to-the-enterprise" rel="noreferrer">https://www.techrepublic.com/article/these-two-vendors-are-most-likely-to-bring-kubernetes-containers-to-the-enterprise</a></li>
<li><a href="https://www.cloudhealthtech.com/blog/container-wars-are-over-kubernetes-has-won" rel="noreferrer">https://www.cloudhealthtech.com/blog/container-wars-are-over-kubernetes-has-won</a></li>
<li><a href="https://news.ycombinator.com/item?id=12462261" rel="noreferrer">https://news.ycombinator.com/item?id=12462261</a></li>
</ul>
