volcano.sh/volcano@v1.9.0/docs/design/pdb-plugin.md (about)

     1  # Pod Disruption Budget (PDB) Plugin
     2  
     3  ## Introduction
     4  
     5  When users apply jobs to volcano, they may limit the number of Pod copies that are destroyed at the same time. This restriction is often limited by the [PDB resources](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) created by the user. So PDB plugin is provided to meet the PBD constraints set by the user during the Volcano scheduling process.
     6  
     7  ## Usage
     8  1. Firstly, please ensure that your k8s version is at least 1.21 and that you have created the PDB resource.
     9  2. Secondly, user can open `PDB Plugin` via `volcano-scheduler-configmap` in following format:
    10  
    11        ```yaml
    12          actions: "reclaim, preempt, shuffle"
    13          tiers:
    14          - plugins:
    15            - name: pdb
    16        ```
    17  *PDB Plugin can be used in any one action of reclaim, preempt, shuffle*
    18  
    19  ## Solution
    20  The plugin register , `ReclaimableFn`, `PreemptableFn` and `VictimTasksFn` in `Reclaim`, `Preempt` and `Shuffle` action to filter out tasks that violate the PDB constraint.
    21  
    22  The execution flow chart of filter process of `pdb` plugin is shown as below:
    23  
    24  ![workflow](./images/pdb-workflow.png)
    25  
    26  *`DisruptedPods` contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller.*
    27  
    28  ### About the Cache
    29  The PDB plugin first registers `informerFactory.Policy().V1().PodDisruptionBudgets()` in `newSchedulerCache()` function.
    30  
    31  Then the plugin adds `v1.PodDisruptionBudgetLister` variable to type definition and inits it with `informerFactory.Policy().V1().PodDisruptionBudgets().Lister()` in `New()` function.
    32  
    33  Finally the plugin uses this `Lister` to list the PDBs from the informer cache.
    34  ## Feature Interaction
    35  
    36  1. By now we only need 1 argument `sla-waiting-time`, so I add it into annotations for simplicity and invocation, but when `sla` plugin is extended with more arguments, a better way to invoke this plugin may be job plugin like `svc` and `ssh`.
    37