<p>When deploying Kubernetes Daemonset, what will happen when single node (out of a few nodes) is almost out of resource, and a pod can't be created, and when there are no pods that can be evicted? Though Kubernetes can be horizontally scaled, I believe it is meaningless to scale horizontally as Daemonset would need every pod on each node.</p>

Piljae Chae
<blockquote>
<p>Though Kubernetes can be horizontally scaled, I believe it is meaningless to scale horizontally as Daemonset would need every pod on each node.</p>
</blockquote>
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> is a workload type that is mostly for <em>operations workload</em> e.g. transporting logs from the node or similar &quot;system services&quot;. It is rarely a good fit for workload that is serving your users, but it can be.</p>
<blockquote>
<p>what will happen when single node (out of a few nodes) is almost out of resource, and a pod can't be created, and when there are no pods that can be evicted?</p>
</blockquote>
<p>As I described above, workload deployed with <code>DaemonSet</code> is typically <em>operations workload</em> that has e.g. an infrastructure role in your cluster. Since this may be more critical pods (or less, depending on what you want), I would use a higher <em>Quality of Service</em> for these pods, so that other pods is evicted when there are few resources on the node.</p>
<p>See <a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/" rel="nofollow noreferrer">Configure Quality of Service for Pods</a> for how to configure your Pods to be in a Quality of Service class, one of:</p>
<ul>
<li>Guaranteed</li>
<li>Burstable</li>
<li>Best Effort</li>
</ul>
<p>You might also consider to use <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/" rel="nofollow noreferrer">Pod Priority and Preemption</a></p>
<p>The question was about <code>DaemonSet</code> but as a final note: Workload that serves requests from your users, typically is deployed as <code>Deployment</code> and for those, it is very easy to do horizontal scaling using <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaler</a>.</p>
