<p>I've been trying to figure out what happens when the Kubernetes master fails in a cluster that only has one master. Do web requests still get routed to pods if this happens, or does the entire system just shut down?</p>

<p>According to the OpenShift 3 documentation, which is built on top of Kubernetes, (<a href="https://docs.openshift.com/enterprise/3.2/architecture/infrastructure_components/kubernetes_infrastructure.html" rel="noreferrer">https://docs.openshift.com/enterprise/3.2/architecture/infrastructure_components/kubernetes_infrastructure.html</a>), if a master fails, nodes continue to function properly, but the system looses its ability to manage pods. Is this the same for vanilla Kubernetes?</p>

<p>In typical setups, the master nodes run both the API and etcd and are either largely or fully responsible for managing the underlying cloud infrastructure. When they are offline or degraded, the API will be offline or degraded.</p>
<p>In the event that they, etcd, or the API are fully offline, the cluster ceases to be a cluster and is instead a bunch of ad-hoc nodes for this period. The cluster will not be able to respond to node failures, create new resources, move pods to new nodes, etc. Until both:</p>
<ol>
<li>Enough etcd instances are back online to form a quorum and make progress (for a visual explanation of how this works and what these terms mean, see <a href="https://raft.github.io/" rel="noreferrer">this page</a>).</li>
<li>At least one API server can service requests</li>
</ol>
<p>In a partially degraded state, the API server may be able to respond to requests that only read data.</p>
<p>However, in any case, life for applications will continue as normal unless nodes are rebooted, or there is a dramatic failure of some sort during this time, because TCP/ UDP services, load balancers, DNS, the dashboard, etc. Should all continue to function for at least some time. Eventually, these things will all fail on different timescales. In single master setups or complete API failure, DNS failure will probably happen first as caches expire (on the order of minutes, <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/" rel="noreferrer">though the exact timing is configurable</a>, see <a href="https://coredns.io/plugins/cache/" rel="noreferrer">the coredns cache plugin documentation</a>). This is a good reason to consider a multi-master setup–DNS and service routing can continue to function indefinitely in a degraded state, even if etcd can no longer make progress.</p>
<p>There are actions that you could take as an operator which would accelerate failures, especially in a fully degraded state. For instance, rebooting a node would cause DNS queries and in fact probably all pod and service networking functionality until at least one master comes back online. Restarting DNS pods or kube-proxy would also be bad.</p>
<p>If you'd like to test this out yourself, I recommend <a href="https://github.com/kubernetes-sigs/kubeadm-dind-cluster" rel="noreferrer">kubeadm-dind-cluster</a>, <a href="https://github.com/kubernetes-sigs/kind" rel="noreferrer">kind</a> or, for more exotic setups, kubeadm on VMs or bare metal. Note: <code>kubectl proxy</code> will not work during API failure, as that routes traffic through the master(s).</p>
