<p>I am trying to deploy a <a href="https://kubernetes.io/docs/tasks/run-application/configure-pdb/" rel="nofollow noreferrer">PodDisruptionBudget</a> for my deployment, but when I deploy this example</p>
<pre><code>apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: example-pdb
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app: example-deployment
</code></pre>
<p>with this deployment</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: example-deployment-app
  template:
    metadata:
      labels:
        app: example-deployment-app
    spec:
        ...
</code></pre>
<p>I get the response</p>
<pre><code>$ kubectl get pdb
NAME          MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
example-pdb   1               N/A               0                     7s
</code></pre>
<p>What does it mean for &quot;ALLOWED DISRUPTIONS&quot; to be 0?</p>

<p>As mentioned by <a href="https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget" rel="noreferrer">Specifying a PodDisruptionBudget</a>:</p>
<blockquote>
<p>A <code>PodDisruptionBudget</code> has three fields:</p>
<ul>
<li><p>A label selector <code>.spec.selector</code> to specify the set of pods to which it applies. This field is required.</p>
</li>
<li><p><code>.spec.minAvailable</code> which is a description of the number of pods from that set that must still be available after the eviction, even in
the absence of the evicted pod. <code>minAvailable</code> can be either an
absolute number or a percentage.</p>
</li>
<li><p><code>.spec.maxUnavailable</code> (available in Kubernetes 1.7 and higher) which is a description of the number of pods from that set that can be
unavailable after the eviction. It can be either an absolute number or
a percentage.</p>
</li>
</ul>
</blockquote>
<p>In your case the <code>.spec.minAvailable</code> is set to <code>1</code>, so <code>1</code> Pod must always be available, even during a disruption.</p>
<p>Now looking at your Deployment's <code>.spec.replicas</code> is set to <code>1</code> which in combination of <code>.spec.minAvailable: 1</code> means that there are no disruptions allowed for that config.</p>
<p>Take a look at the <a href="https://kubernetes.io/docs/tasks/run-application/configure-pdb/#check-the-status-of-the-pdb" rel="noreferrer">official example</a>:</p>
<blockquote>
<p>Use <code>kubectl</code> to check that your PDB is created.</p>
<p>Assuming you don't actually have pods matching <code>app: zookeeper</code> in
your namespace, then you'll see something like this:</p>
<pre><code>kubectl get poddisruptionbudgets
NAME     MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
zk-pdb   2               N/A               0                     7s
</code></pre>
<p>If there are matching pods (say, 3), then you would see something like
this:</p>
<pre><code>kubectl get poddisruptionbudgets
NAME     MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
zk-pdb   2               N/A               1                     7s
</code></pre>
<p>The non-zero value for <code>ALLOWED DISRUPTIONS</code> means that the disruption
controller has seen the pods, counted the matching pods, and updated
the status of the PDB.</p>
<p>You can get more information about the status of a PDB with this
command:</p>
<pre><code>kubectl get poddisruptionbudgets zk-pdb -o yaml

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  annotations:
…
  creationTimestamp: &quot;2020-03-04T04:22:56Z&quot;
  generation: 1
  name: zk-pdb
…
status:
  currentHealthy: 3
  desiredHealthy: 2
  disruptionsAllowed: 1
  expectedPods: 3
  observedGeneration: 1
</code></pre>
</blockquote>
<p>You can see that if the <code>.spec.minAvailable</code> is set to 2 and there are 3 running Pods than the <code>disruptionsAllowed</code> is actually <code>1</code>. You can check the same with your use case.</p>
