<p>In my project, I need to test if Guaranteed Application pods should evict any dummy application pods which are running. How do I achieve that application pods always have the highest priority?</p>

<p>The answer provided by the <a href="https://stackoverflow.com/users/6309601/p">P....</a> is very good and useful. By <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/" rel="nofollow noreferrer">Pod Priority and Preemption</a> you can achieve what you are up to.</p>
<p>However, apart from that, you can use dedicated solutions, for example in the clouds. Look at the <a href="https://cloud.google.com/blog/products/gcp/get-the-most-out-of-google-kubernetes-engine-with-priority-and-preemption" rel="nofollow noreferrer">Google cloud example</a>:</p>
<blockquote>
<p>Before priority and preemption, Kubernetes pods were scheduled purely on a first-come-first-served basis, and ran to completion (or forever, in the case of pods created by something like a Deployment or StatefulSet). This meant less important workloads could block more important, later-arriving, workloads from running—not the desired effect. Priority and preemption solves this problem.</p>
<p>Priority and preemption is valuable in a number of scenarios. For example, imagine you want to cap autoscaling to a maximum cluster size to control costs, or you have clusters that you can’t grow in real-time (e.g., because they are on-premises and you need to buy and install additional hardware). Or you have high-priority cloud workloads that need to scale up faster than the cluster autoscaler can add nodes. In short, priority and preemption lead to better resource utilization, lower costs and better service levels for critical applications.</p>
</blockquote>
<p>Additional guides for other clouds:</p>
<ul>
<li><a href="https://cloud.ibm.com/docs/containers?topic=containers-pod_priority" rel="nofollow noreferrer">IBM cloud</a></li>
<li><a href="https://www.eksworkshop.com/intermediate/201_resource_management/pod-priority/" rel="nofollow noreferrer">AWS cloud</a></li>
<li><a href="https://learn.microsoft.com/en-us/azure/aks/operator-best-practices-advanced-scheduler" rel="nofollow noreferrer">Azure cloud</a></li>
<li><a href="https://docs.openshift.com/container-platform/4.7/nodes/pods/nodes-pods-priority.html" rel="nofollow noreferrer">RedHat Openshift</a></li>
</ul>
<p>See also <a href="https://mohaamer5.medium.com/kubernetes-pod-priority-and-preemption-943c58aee07d" rel="nofollow noreferrer">this useful tutorial</a>.</p>
