<p>I have a kubernetes cluster setup at home on two bare metal machines.
I used kubespray to install both and it uses kubeadm behind the scenes.</p>
<p>The problem I encounter is that all containers within the cluster have a restartPolicy: no which makes my cluster break when I restart the main node.</p>
<p>I have to manually run &quot;docker container start&quot; for all containers in &quot;kube-system&quot; namespace to make it work after reboot.</p>
<p>Does anyone have an idea where the problem might be coming from ?</p>

sashok_bg
<p>Docker provides <a href="https://docs.docker.com/engine/reference/run/#restart-policies---restart" rel="nofollow noreferrer">restart policies</a> to control whether your containers start automatically when they exit, or when Docker restarts. Here your containers have the <strong>restart policy - no</strong> which means this policy will never automatically start the container under any circumstance.</p>
<p>You need to change the restart policy to <strong>Always</strong> which restarts the container if it stops. If it is manually stopped, it is restarted only when Docker daemon restarts or the container itself is manually restarted.</p>
<p>You can change the restart policy of an existing container using <strong><code>docker update</code></strong>. Pass the name of the container to the command. You can find container names by running <strong><code>docker ps -a</code>.</strong></p>
<pre><code>docker update --restart=always &lt;CONTAINER NAME&gt;
</code></pre>
<p><strong>Restart policy details:</strong></p>
<p>Keep the following in mind when using restart policies:</p>
<ul>
<li><p>A restart policy only takes effect after a container starts successfully. In this case, starting successfully means that the container is up for at least 10 seconds and Docker has started monitoring it. This prevents a container which does not start at all from going into a restart loop.</p>
</li>
<li><p>If you manually stop a container, its restart policy is ignored until the Docker daemon restarts or the container is manually restarted. This is another attempt to prevent a restart loop.</p>
</li>
</ul>
