<p>I want to deploy a single Pod on a Node to host my service (like GitLab for the example). The problem is : a Pod will not be re-created after the Node failure (like a reboot). The solution(s) : Use a StatefulSet, ReplicaSet or DaemonSet to ensure the Pod creation after a Node failure. But what is the best for this case ?</p>

<p>This Pod is stateful (I am using volume <code>hostPath</code> to keep the data) and is deployed using <code>nodeSelector</code> to keep it always on the same Node.</p>

<p>Here is a simple YAML file for the example : <a href="https://pastebin.com/WNDYTqSG" rel="nofollow noreferrer">https://pastebin.com/WNDYTqSG</a></p>

<p>It creates 3 Pods (one for each <code>Set</code>) with a volume to keep the data statefully. In practice, all of these solutions can feet my needs, but I don't know if there are best practices for this case.</p>

<p>Can you help me to choose between these solutions to deploy a single stateful Pod please ?</p>

<p>Deployment is the most common option to manage a Pod or set of Pods. These are normally used instead of ReplicaSets as they are more flexible and creating a Deployment results in a ReplicaSet - see <a href="https://www.mirantis.com/blog/kubernetes-replication-controller-replica-set-and-deployments-understanding-replication-options/" rel="noreferrer">https://www.mirantis.com/blog/kubernetes-replication-controller-replica-set-and-deployments-understanding-replication-options/</a></p>

<p>You would only need a StatefulSet if you had multiple Pods and needed dedicated persistence per Pod or you had multiple Pods and the Pods need individual names because they relate to each other (e.g. one is a leader) - <a href="https://stackoverflow.com/a/48006210/9705485">https://stackoverflow.com/a/48006210/9705485</a></p>

<p>A DaemonSet would be used when you want one Pod/replica per Node</p>
