<p>I see advantages of Kubernetes which include Rolling Deployments, Automatic Health check monitoring, and swinging a new server to action when an existing one fails.  I also do understand that Kubernetes is not just for Docker.  </p>

<p>So, that brings a couple of questions!  </p>

<p>When Azure, and Service Fabric could provide all that I said (and beyond), why would I need Kubernetes? </p>

<p>Would it make sense for one to use Kubernetes along with Service Fabric for large scale deployments on Azure?</p>

<p>Let's look first at the similarities between Kubernetes and Service Fabric. </p>

<ul>
<li>They are both cloud-agnostic clustering, orchestration, and scheduling software.</li>
<li>They can both be deployed manually, by you, to any set of VMs, anywhere.</li>
<li>There are "managed" offerings for both, meaning a cloud provider like Azure or Google Cloud will host a cluster for you, but generally you still own the VMs.</li>
<li>They both deploy and manage containers.</li>
<li>They both have rich management operations, such as rolling upgrades, health checks, and self-healing capabilities.</li>
</ul>

<p>That's a fairly high-level view but should give you an idea of what and where you can run with each.</p>

<p>Now let's look where they're different. There are a ton of small differences, but I want to focus on two of the really big conceptual differences:</p>

<ul>
<li><p><strong>Application model</strong>:</p>

<ul>
<li>Service Fabric allows you to orchestrate any arbitrary container or EXE (whether that's a small node.js app or a giant legacy application), and in that sense it is similar to Kubernetes. But overall it is more focused on application development specifically, with  programming models that are integrated with the platform. In this respect, it is more closely comparable to Cloud Foundry than Kubernetes.</li>
<li>Kubernetes is focused more on orchestrating infrastructure for an application. It doesn't really focus on <em>how</em> you write your application. That's up to you to figure out; Kubernetes just wants a container to run, doesn't matter what's in it.</li>
</ul></li>
<li><p><strong>State management</strong></p>

<ul>
<li>Kubernetes <em>allows you to deploy</em> stateful software to it, by providing persistent disk storage volumes to containers and assigning unique identifiers to pods. This lets you deploy things like ZooKeeper or MySQL.</li>
<li>Service Fabric <em>is</em> stateful software. Service Fabric is designed as a stateful, data-aware platform. It provides HA state and scale-out primitives. So while Kubernetes allows you to <em>deploy</em> stateful things, Service Fabric allows you to <em>build</em> stateful things. This is one of the key differences that's often overlooked. For example:

<ul>
<li>On Kubernetes, you can deploy ZooKeeper. </li>
<li>On Service Fabric, you can actually build ZooKeeper yourself using Service Fabric's replication and leader election primitives.</li>
<li>Kubernetes uses etcd for distributed, reliable storage about the state of the cluster.</li>
<li>Service Fabric doesn't <em>need</em> etcd, because Service Fabric itself is a distributed, reliable storage platform. The system services in Service Fabric make use of this to reliably store the state of the cluster. This makes Service Fabric entirely self-contained.</li>
</ul></li>
</ul></li>
</ul>

<p>The fact that Service Fabric is a stateful platform is key to understanding it and how it differs from other major orchestrators. Everything it does - scheduling, health checking, rolling upgrades, application versioning, failover, self-healing, etc - are all designed around the fact that it is managing replicated and distributed data that needs to be consistent and highly available at all times. </p>
