Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-31420

PDB with minAvailable=0 still prevent drain if 0 pods are in Ready state

    XMLWordPrintable

Details

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None

    Description

      Description of problem:

      The `PDB(PodDisruptionBudget)` with `minAvailable=0` is preventing node drain when ready pod is in crashloop,error or in notready state.

      Version-Release number of selected component (if applicable):

      4.12

      How reproducible:

         yes 

      Steps to Reproduce:

          1. Create deployment which should fail
      ~~~
      mdeore@mdeore-mac Manifest % cat deployment.yaml
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: test-deployment
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: test
        template:
          metadata:
            labels:
              app: test
          spec:
            containers:
            - name: nginx
              image: registry.access.redhat.com/ubi8/nginx-120
              ports:
              - containerPort: 8080
              readinessProbe:
                httpGet:
                  path: /
                  port: 80
                initialDelaySeconds: 10
                periodSeconds: 5
                failureThreshold: 3
      ~~~
          2. Create PDB with minAvailable: 0
      ~~~
      mdeore@mdeore-mac Manifest % cat pdb.yaml
      apiVersion: policy/v1
      kind: PodDisruptionBudget
      metadata:
        name: test-pdb1
      spec:
        minAvailable: 0
        selector:
          matchLabels:
            deployment: httpd
      ~~~    
         3. Check pod and PDB
      ~~~
      NAME                              READY   STATUS             RESTARTS     AGE
      test-deployment-f7d699487-25bcd   0/1     CrashLoopBackOff   7 (9s ago)   11m
      mdeore@mdeore-mac Manifest % oc get pdb
      NAME       MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
      test-pdb   0               N/A               0                     5s
      ~~~
         4. Drain the node in which pod is schudled
      ~~~
      % oc adm drain worker-1.mdeore11.lab.psi.pnq2.redhat.com --delete-local-data --ignore-daemonsets --force
      ~~~     

      Actual results:

          Drain is failing due to pdb
      ~~~
      error when evicting pods/"mypod" -n "test" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.
      ~~~

      Expected results:

      Drain should be successfull wethoud any issue for this test pod as minAvailable is set to`0`

      Additional info:

      If we do same test with pod which is in ready state. Drain is working fine wethout any issue.

      Attachments

        Activity

          People

            fkrepins@redhat.com Filip Krepinsky
            rhn-support-mdeore Mayur Deore
            Workloads Team Bot Account Workloads Team Bot Account
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: