Skip to content

Commit e1480d7

Browse files
authored
docs: add PD-aware examples for by-label and by-label-selector plugins (#454)
Signed-off-by: CYJiang <googs1025@gmail.com>
1 parent 4a5bc2a commit e1480d7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/architecture.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,51 @@ Filters out pods using a standard Kubernetes label selector.
223223
- **Parameters**: A standard Kubernetes label selector.
224224
- `matchLabels`: map of `{key,value}` pairs. If more than one pair are in the map, all of the keys are checked and the results are combined with AND logic.
225225

226+
Example configuration with the above parameters set:
227+
228+
```yaml
229+
plugins:
230+
- type: by-label-selector
231+
parameters:
232+
matchLabels:
233+
inference-role: decode
234+
hardware-type: H100
235+
```
236+
237+
In this example:
238+
- Only pods that have **both** labels
239+
`inference-role=decode` **and** `hardware-type=H100`
240+
will be selected.
241+
- Pods missing either label, or having a different value (e.g., `inference-role=prefill`), are **filtered out**.
242+
- The matching logic follows standard Kubernetes label selector semantics: all key-value pairs in `matchLabels` must match (**AND** logic).
243+
244+
---
245+
246+
#### ByLabel
247+
248+
Filters out pods that do not have a specific label with one of the allowed values. Pods missing the label are either filtered out or retained based on the `allowsNoLabel` setting.
249+
250+
- **Type**: `by-label`
251+
- **Parameters**:
252+
- `label` (string, required): The name of the Kubernetes label to inspect on each pod.
253+
- `validValues` (list of strings, required unless `allowsNoLabel=true`): A list of acceptable label values. A pod is kept if its label value matches any entry in this list.
254+
- `allowsNoLabel` (boolean, optional, default: `false`): If `true`, pods that **do not have the specified label at all** will be **included** in the candidate set. If `false` (default), such pods are filtered out.
255+
256+
Example configuration with the above parameters set:
257+
258+
```yaml
259+
plugins:
260+
- type: by-label
261+
parameters:
262+
label: "inference-role"
263+
validValues: ["decode", "both"]
264+
allowsNoLabel: false
265+
```
266+
267+
In this example:
268+
- Only pods labeled for decoding (`inference-role=decode`) or supporting both stages (`inference-role=both`) are selected.
269+
- Pods missing the `inference-role` label are not considered for decode scheduling.
270+
226271
---
227272

228273
#### DecodeFilter

0 commit comments

Comments
 (0)