Update resource-bin-packing.md

The original documentation was using `Profile` instead of the `KubeSchedulerConfiguration`.  Also clarified how you pass this configuration to the scheduler.
This commit is contained in:
Jeremy Cowan 2021-05-28 21:47:14 -05:00 committed by GitHub
parent a7de342b39
commit 610835108f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 25 deletions

View File

@ -26,40 +26,41 @@ each resource to score nodes based on the request to capacity ratio. This
allows users to bin pack extended resources by using appropriate parameters allows users to bin pack extended resources by using appropriate parameters
and improves the utilization of scarce resources in large clusters. The and improves the utilization of scarce resources in large clusters. The
behavior of the `RequestedToCapacityRatioResourceAllocation` priority function behavior of the `RequestedToCapacityRatioResourceAllocation` priority function
can be controlled by a configuration option called can be controlled by a configuration option called `RequestedToCapacityRatioArgs`.
`requestedToCapacityRatioArguments`. This argument consists of two parameters This argument consists of two parameters `shape` and `resources`. The `shape`
`shape` and `resources`. The `shape` parameter allows the user to tune the parameter allows the user to tune the function as least requested or most
function as least requested or most requested based on `utilization` and requested based on `utilization` and `score` values. The `resources` parameter
`score` values. The `resources` parameter consists of `name` of the resource consists of `name` of the resource to be considered during scoring and `weight`
to be considered during scoring and `weight` specify the weight of each specify the weight of each resource.
resource.
Below is an example configuration that sets Below is an example configuration that sets
`requestedToCapacityRatioArguments` to bin packing behavior for extended `requestedToCapacityRatioArguments` to bin packing behavior for extended
resources `intel.com/foo` and `intel.com/bar`. resources `intel.com/foo` and `intel.com/bar`.
```yaml ```yaml
apiVersion: v1 apiVersion: kubescheduler.config.k8s.io/v1beta1
kind: Policy kind: KubeSchedulerConfiguration
profiles:
# ... # ...
priorities: pluginConfig:
# ... - name: RequestedToCapacityRatio
- name: RequestedToCapacityRatioPriority args:
weight: 2 shape:
argument: - utilization: 0
requestedToCapacityRatioArguments: score: 10
shape: - utilization: 100
- utilization: 0 score: 0
score: 0 resources:
- utilization: 100 - name: intel.com/foo
score: 10 weight: 3
resources: - name: intel.com/bar
- name: intel.com/foo weight: 5
weight: 3
- name: intel.com/bar
weight: 5
``` ```
Referencing the `KubeSchedulerConfiguration` file with the kube-scheduler
flag `--config=/path/to/config/file` will pass the configuration to the
scheduler.
**This feature is disabled by default** **This feature is disabled by default**
### Tuning the Priority Function ### Tuning the Priority Function