<p>I wanted to test PDB policy effectiveness on local minikube setup. </p>

<ul>
<li>Created a NGINX deployment with replicas=5. </li>
<li>Created a PDB for NGINX to minAvailable=2. Shows AllowedDisruptions=3. </li>
<li>Updated deployment with replicas=0. </li>
<li>All NGINX pods were killed and deployment showed 0/0 despite PDB being in effect.</li>
<li>Now PDB shows AllowedDisruptions=0.</li>
</ul>

<p>Why was PDB not respected and stopped from killing all the pods?</p>

<p>Is this is a testable scenario or my understanding of pod eviction which respects PDB not correct?
Please advise.</p>

AbhishekN
<p>The recommended way to test PDB is by <a href="https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/" rel="nofollow noreferrer">draining a node</a>.<strong>Updating the replica count is not considered a disruption</strong>. PDB kicks in when a pod is evicted using the eviction API which happens while draining a node.</p>

<p>Here is the list of involuntary disruptions</p>

<ol>
<li>a hardware failure of the physical machine backing the node</li>
<li>cluster administrator deletes VM (instance) by mistake</li>
<li>cloud provider or hypervisor failure makes VM disappear</li>
<li>a kernel panic</li>
<li>the node disappears from the cluster due to cluster network partition
eviction of a pod due to the node being out-of-resources.</li>
</ol>

<p>Here is the list of voluntary disruptions</p>

<ol>
<li>deleting the deployment or other controller that manages the pod</li>
<li>updating a deployment’s pod template causing a restart</li>
<li>directly deleting a pod (e.g. by accident)</li>
</ol>

<p><a href="https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#how-disruption-budgets-work" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#how-disruption-budgets-work</a></p>
