Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jiamin13579 committed Apr 4, 2023
1 parent 1cf8fbd commit 0d71a43
Showing 1 changed file with 76 additions and 1 deletion.
77 changes: 76 additions & 1 deletion docs/design/multi-scheduler.md
Expand Up @@ -21,7 +21,8 @@ The configmap defines some resource groups, each resource group contains
- Annotation field
- The pod's data volcano needs to patch, volcano support to patch the fields and the fields are optional and not mandatory. User can set them according the application scenario.
- Tolerations
- NodeSelector
- Affinity
- NodeSelector
- SchedulerName

If the object field is not setted, it is filled with a default as the following:
Expand Down Expand Up @@ -67,6 +68,14 @@ data:
schedulerName: volcano # the annotation key is fixed and is "volcano.sh/resource-group", The corresponding value is the resourceGroup field
labels:
volcano.sh/nodetype: gpu
- resourceGroup: fixed # if the object is unsetted, default is: the key is annotation,
schedulerName: volcano # the annotation key is fixed and is "volcano.sh/resource-group", The corresponding value is the resourceGroup field
object:
key: annotation
value:
- "volcano.sh/resource-group-job-role: master"
# set the affinity for patching, the format is a json string.
affinity: "{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"volcano.sh/nodetype\",\"operator\":\"In\",\"values\":[\"fixed\"]}]}]}}}"
````

### The pod mutate process
Expand Down Expand Up @@ -205,6 +214,72 @@ schedulerName: volcano
The pod in job-A is scheduled to node1.
The pod in job-B job is scheduled to node2.
````

### case 3

Here is a cluster as the following:

|node|label|
|----|-----|
|node1| volcano.sh/nodetype: fixed|
|node2| none| none|

|volcano job | annotation|
|----|----|
|job-A|volcano.sh/resource-group-job-role: master|
|job-B|none|

1. Edit volcano-admission-configmap
````
apiVersion: v1
kind: ConfigMap
metadata:
name: volcano-admission-configmap
namespace: volcano-system
data:
volcano-admission.conf: |
resourceGroups:
- resourceGroup: fixed # if the object is unsetted, default is: the key is annotation,
schedulerName: volcano # the annotation key is fixed and is "volcano.sh/resource-group", The corresponding value is the resourceGroup field
object:
key: annotation
value:
- "volcano.sh/resource-group-job-role: master"
# set the affinity for patching, the format is a json string.
affinity: "{\"nodeAffinity\":{\"requiredDuringSchedulingIgnoredDuringExecution\":{\"nodeSelectorTerms\":[{\"matchExpressions\":[{\"key\":\"volcano.sh/nodetype",\"operator\":\"In\",\"values\":[\"fixed\"]}]}]}}}"
````
2. Submit job-A and job-B

3. Check the Pod information

````
job-A:
....
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: volcano.sh/nodetype
operator: In
values:
- fixed
...
schedulerName: volcano
....
job-B:
....
...
schedulerName: volcano
....
````
4. Check the result of the pod's scheduling
````
The pod in job-A is scheduled to node1.
The pod in job-B job is scheduled to node1/node2.
````

## NOTE

Enable this feature may modify pod information and affect resource utilization.
Expand Down

0 comments on commit 0d71a43

Please sign in to comment.