<p>Just curious, with mesos I'm used to being able to do <code>systemctl stop mesos-master</code> and <code>systemctl start mesos-master</code> (if I need to bounce it for some reason). With k8s, there are multiple components to 'stop' in the control plane, such as apiserver, controller-manager, etc.</p>

<p>When creating a cluster with kubeadm, it runs the control plane as pods (no replica set, or anything like that, perhaps because I only have a single master at the moment).</p>

<p>What's the best way to stop the things in the control plane and then start them again, without tearing down the cluster?</p>

<p>The Kubernetes control plane pods are often deployed as <a href="https://kubernetes.io/docs/tasks/administer-cluster/static-pod/" rel="noreferrer">Static Pods</a>. These are not managed by any kind of Deployment controller, but are defined in static (hence the name) configuration files that are placed in a configuration directory (like for example <code>/etc/kubelet.d/</code> or <code>/etc/kubernetes/manifests</code>, depending on how your cluster is set up). These definition files are picked up by the Kubelet running on the Kubernetes master node that creates the respective pods.</p>

<p>According to the documentation, you can stop/delete static pods simply by removing the respective configuration files, and start/create them again by creating new files:</p>

<blockquote>
  <p>Running kubelet periodically scans the configured directory (<code>/etc/kubelet.d</code> in our example) for changes and adds/removes pods as files appear/disappear in this directory.</p>

<pre><code>[joe@my-node1 ~] $ mv /etc/kubelet.d/static-web.yaml /tmp
[joe@my-node1 ~] $ sleep 20
[joe@my-node1 ~] $ docker ps
// no nginx container is running
[joe@my-node1 ~] $ mv /tmp/static-web.yaml  /etc/kubelet.d/
[joe@my-node1 ~] $ sleep 20
[joe@my-node1 ~] $ docker ps
CONTAINER ID        IMAGE         COMMAND                CREATED           ...
e7a62e3427f1        nginx:latest  "nginx -g 'daemon of   27 seconds ago
</code></pre>
</blockquote>

<p>To temporarily disable/enable these pods, simply move the definition files to a safe location and back again:</p>

<pre><code>$ mv /etc/kubelet.d/*.yaml /tmp   # Disable static pods
$ mv /tmp/*.yaml /etc/kubelet.d   # Re-enable static pods
</code></pre>
