插件簡介
Volcano調度器是一個基于Kubernetes的批處理平臺,提供了機器學習、深度學習、生物信息學、基因組學及其他大數據應用所需要而Kubernetes當前缺失的一系列特性。
Volcano提供了高性能任務調度引擎、高性能異構芯片管理、高性能任務運行管理等通用計算能力,通過接入AI、大數據、基因、渲染等諸多行業計算框架服務終端用戶。(目前Volcano項目已經在Github開源)
Volcano針對計算型應用提供了作業調度、作業管理、隊列管理等多項功能,主要特性包括:
- 豐富的計算框架支持:通過CRD提供了批量計算任務的通用API,通過提供豐富的插件及作業生命周期高級管理,支持TensorFlow,MPI,Spark等計算框架容器化運行在Kubernetes上。
- 高級調度:面向批量計算、高性能計算場景提供豐富的高級調度能力,包括成組調度,優先級搶占、裝箱、資源預留、任務拓撲關系等。
- 隊列管理:支持分隊列調度,提供隊列優先級、多級隊列等復雜任務調度能力。
項目開源地址:
安裝插件
步驟 1 登錄CCE控制臺,單擊集群名稱進入集群,單擊左側導航欄的“插件管理”,在右側找到 Volcano ,單擊“安裝”。
步驟 2 該插件可配置“單實例”、“高可用”或自定義規格。
選擇自定義時,volcano-controller和volcano-scheduler的建議值如下:
- 小于100個節點,可使用默認配置,即CPU的申請值為500m,限制值為2000m;內存的申請值為500Mi,限制值為2000Mi。
- 高于100個節點,每增加100個節點(10000個Pod),建議CPU的申請值增加500m,內存的申請值增加1000Mi;CPU的限制值建議比申請值多1500m,內存的限制值建議比申請值多1000Mi。
volcano-controller和volcano-scheduler的建議值
| 節點/Pods規模 | CPU Request(m) | CPU Limit(m) | Memory Request(Mi) | Memory Limit(Mi) |
|---|---|---|---|---|
| 50/5k | 500 | 2000 | 500 | 2000 |
| 100/1w | 1000 | 2500 | 1500 | 2500 |
| 200/2w | 1500 | 3000 | 2500 | 3500 |
| 300/3w | 2000 | 3500 | 3500 | 4500 |
| 400/4w | 2500 | 4000 | 4500 | 5500 |
步驟 3 配置volcano默認調度器配置參數。
ca_cert: ''
default_scheduler_conf:
actions: 'allocate, backfill'
tiers:
- plugins:
- name: 'priority'
- name: 'gang'
- name: 'conformance'
- plugins:
- name: 'drf'
- name: 'predicates'
- name: 'nodeorder'
- plugins:
- name: 'cce-gpu-topology-predicate'
- name: 'cce-gpu-topology-priority'
- name: 'cce-gpu'
- plugins:
- name: 'nodelocalvolume'
- name: 'nodeemptydirvolume'
- name: 'nodeCSIscheduling'
- name: 'networkresource'
server_cert: ''
server_key: ''
| 插件 | 功能 | 參數說明 | 用法演示 |
|---|---|---|---|
| binpack | 將pod調度到資源使用較高的節點以減少資源碎片 | binpack.weight:binpack插件本身在所有插件打分中的權重 binpack.cpu:cpu資源在資源比重的比例,默認是1 binpack.memory:memory資源在所有資源中的比例,默認是1l binpack.resources: |
- plugins: - name: binpack arguments: binpack.weight: 10 binpack.cpu: 1 binpack.memory: 1 binpack.resources: nvidia.com/gpu, example.com/foo binpack.resources.nvidia.com/gpu: 2 binpack.resources.example.com/foo: 3 |
| conformance | 跳過關鍵Pod,比如在kube-system命名空間的Pod,防止這些Pod被驅逐 | - | - |
| gang | 將一組pod看做一個整體去分配資源 | - | - |
| priority | 使用用戶自定義負載的優先級進行調度 | - | - |
| overcommit | 將集群的資源放到一定倍數后調度,提高負載入隊效率。負載都是deployment的時候,建議去掉此插件或者設置擴大因子為2.0。 | overcommit-factor: 擴大因子,默認是1.2 | - plugins: - name: overcommit arguments: overcommit-factor: 2.0 |
| drf | 根據作業使用的主導資源份額進行調度,用的越少的優先 | - | - |
| predicates | 預選節點的常用算法,包括節點親和,pod親和,污點容忍,node ports重復,volume limits,volume zone匹配等一系列基礎算法 | - | - |
| nodeorder | 優選節點的常用算法 | nodeaffinity.weight:節點親和性優先調度,默認值是1 podaffinity.weight:pod親和性優先調度,默認值是1 leastrequested.weight:資源分配最少的的節點優先,默認值是1 balancedresource.weight:node上面的不同資源分配平衡的優先,默認值是1 mostrequested.weight:資源分配最多的的節點優先,默認值是0 tainttoleration.weight:污點容忍高的優先調度,默認值是1 imagelocality.weight:node上面有pod需要鏡像的優先調度,默認值是1 selectorspread.weight: 把pod均勻調度到不同的節點上,默認值是0 volumebinding.weight: local pv延遲綁定調度,默認值是1 podtopologyspread.weight: pod拓撲調度,默認值是2 |
- plugins: - name: nodeorder arguments: leastrequested.weight: 1 mostrequested.weight: 0 nodeaffinity.weight: 1 podaffinity.weight: 1 balancedresource.weight: 1 tainttoleration.weight: 1 imagelocality.weight: 1 volumebinding.weight: 1 podtopologyspread.weight: 2 |
| cce-gpu-topology-predicate | GPU拓撲調度預選算法 | - | - |
| cce-gpu-topology-priority | GPU拓撲調度優選算法 | - | - |
| cce-gpu | 結合CCE的GPU插件支持GPU資源分配,支持小數GPU配置 | - | - |
| numaaware | numa拓撲調度 | weight: 插件的權重 | |
| networkresource | 支持預選過濾ENI需求節點,參數由CCE傳遞,不需要手動配置 | NetworkType: 網絡類型(eni或者vpc-router類型) | - |
| nodelocalvolume | 支持預選過濾不符合local volume需求節點 | - | - |
| nodeemptydirvolume | 支持預選過濾不符合emptydir需求節點 | - | - |
| nodeCSIscheduling | 支持預選過濾everest組件異常節點 | - | - |
步驟 4 單擊“安裝”。
在控制臺中修改volcano-scheduler配置
Volcano允許用戶在安裝,升級,編輯時,編寫Volcano調度器配置信息,并將配置內容同步到volcano-scheduler-configmap里。
本節介紹如何使用自定義配置,以便用戶讓volcano-scheduler能更適合自己的場景。
說明
僅Volcano 1.7.1及以上版本支持該功能。在新版插件界面上合并了原plugins.eas_service和resource_exporter_enable等選項,以新選項default_scheduler_conf代替。
您可登錄CCE控制臺,單擊集群名稱進入集群,單擊左側導航欄的“插件管理”,在右側找到 Volcano ,單擊“安裝”或“升級”,并在“參數配置”中設置Volcano調度器配置參數。
使用resource_exporter配置,示例如下:
{
"ca_cert": "",
"default_scheduler_conf": {
"actions": "allocate, backfill",
"tiers": [
{
"plugins": [
{
"name": "priority"
},
{
"name": "gang"
},
{
"name": "conformance"
}
]
},
{
"plugins": [
{
"name": "drf"
},
{
"name": "predicates"
},
{
"name": "nodeorder"
}
]
},
{
"plugins": [
{
"name": "cce-gpu-topology-predicate"
},
{
"name": "cce-gpu-topology-priority"
},
{
"name": "cce-gpu"
},
{
"name": "numa-aware" # add this also enable resource_exporter
}
]
},
{
"plugins": [
{
"name": "nodelocalvolume"
},
{
"name": "nodeemptydirvolume"
},
{
"name": "nodeCSIscheduling"
},
{
"name": "networkresource"
}
]
}
]
},
"server_cert": "",
"server_key": ""
}
開啟后可以同時使用volcano-scheduler的numa-aware插件功能和resource_exporter功能。
- 使用eas_service配置,示例如下:
{
"ca_cert": "",
"default_scheduler_conf": {
"actions": "allocate, backfill",
"tiers": [
{
"plugins": [
{
"name": "priority"
},
{
"name": "gang"
},
{
"name": "conformance"
}
]
},
{
"plugins": [
{
"name": "drf"
},
{
"name": "predicates"
},
{
"name": "nodeorder"
}
]
},
{
"plugins": [
{
"name": "cce-gpu-topology-predicate"
},
{
"name": "cce-gpu-topology-priority"
},
{
"name": "cce-gpu"
},
{
"name": "eas",
"custom": {
"availability_zone_id": "",
"driver_id": "",
"endpoint": "",
"flavor_id": "",
"network_type": "",
"network_virtual_subnet_id": "",
"pool_id": "",
"project_id": "",
"secret_name": "eas-service-secret"
}
}
]
},
{
"plugins": [
{
"name": "nodelocalvolume"
},
{
"name": "nodeemptydirvolume"
},
{
"name": "nodeCSIscheduling"
},
{
"name": "networkresource"
}
]
}
]
},
"server_cert": "",
"server_key": ""
}
- 使用ief配置,示例如下:
{
"ca_cert": "",
"default_scheduler_conf": {
"actions": "allocate, backfill",
"tiers": [
{
"plugins": [
{
"name": "priority"
},
{
"name": "gang"
},
{
"name": "conformance"
}
]
},
{
"plugins": [
{
"name": "drf"
},
{
"name": "predicates"
},
{
"name": "nodeorder"
}
]
},
{
"plugins": [
{
"name": "cce-gpu-topology-predicate"
},
{
"name": "cce-gpu-topology-priority"
},
{
"name": "cce-gpu"
},
{
"name": "ief",
"enableBestNode": true
}
]
},
{
"plugins": [
{
"name": "nodelocalvolume"
},
{
"name": "nodeemptydirvolume"
},
{
"name": "nodeCSIscheduling"
},
{
"name": "networkresource"
}
]
}
]
},
"server_cert": "",
"server_key": ""
}
保留原volcano-scheduler-configmap配置
假如在某場景下希望插件升級后時沿用原配置,可參考以下步驟:
步驟 1 查看原volcano-scheduler-configmap配置,并備份。
示例如下:
#kubectl edit cm volcano-scheduler-configmap -n kube-systemapiVersion: v1
data:
default-scheduler.conf: |-
actions: "enqueue, allocate, backfill"
tiers:
- plugins:
- name: priority
- name: gang
- name: conformance
- plugins:
- name: drf
- name: predicates
- name: nodeorder
- name: binpack
arguments:
binpack.cpu: 100
binpack.weight: 10
binpack.resources: nvidia.com/gpu
binpack.resources.nvidia.com/gpu: 10000
- plugins:
- name: cce-gpu-topology-predicate
- name: cce-gpu-topology-priority
- name: cce-gpu
- plugins:
- name: nodelocalvolume
- name: nodeemptydirvolume
- name: nodeCSIscheduling
- name: networkresource
步驟 2 在控制臺“參數配置”中填寫自定義修改的內容:
{
"ca_cert": "",
"default_scheduler_conf": {
"actions": "enqueue, allocate, backfill",
"tiers": [
{
"plugins": [
{
"name": "priority"
},
{
"name": "gang"
},
{
"name": "conformance"
}
]
},
{
"plugins": [
{
"name": "drf"
},
{
"name": "predicates"
},
{
"name": "nodeorder"
},
{
"name": "binpack",
"arguments": {
"binpack.cpu": 100,
"binpack.weight": 10,
"binpack.resources": "nvidia.com/gpu",
"binpack.resources.nvidia.com/gpu": 10000
}
}
]
},
{
"plugins": [
{
"name": "cce-gpu-topology-predicate"
},
{
"name": "cce-gpu-topology-priority"
},
{
"name": "cce-gpu"
}
]
},
{
"plugins": [
{
"name": "nodelocalvolume"
},
{
"name": "nodeemptydirvolume"
},
{
"name": "nodeCSIscheduling"
},
{
"name": "networkresource"
}
]
}
]
},
"server_cert": "",
"server_key": ""
}
說明
使用該功能時會覆蓋原volcano-scheduler-configmap中內容,所以升級時務必檢查是否在volcano-scheduler-configmap做過修改。如果是,需要把修改內容同步到升級界面里。
Volcano 1.0.0版本升級說明
Volcano 1.0.0版本與后續版本不兼容,不支持在控制臺升級。如想使用新版本Volcano插件,需要先卸載1.0.0版本,然后再在控制臺安裝新版本。
執行如下命令可以卸載Volcano。
kubectl delete crd jobs.batch.volcano.sh
kubectl delete crd commands.bus.volcano.sh
版本記錄
CCE插件版本記錄
插件版本
支持的集群版本
1.7.1
/v1.19.16.*|v1.21.*|v1.23.*|v1.25.*/
1.6.5
/v1.19.*|v1.21.*|v1.23.*/
1.4.2
/v1.15.*|v1.17.*|v1.19.*|v1.21.*/
1.3.3
/v1.15.*|v1.17.*|v1.19.*/
1.3.1
/v1.15.*|v1.17.*|v1.19.*/
1.2.5
/v1.15.*|v1.17.*|v1.19.*/
1.2.3
/v1.15.*|v1.17.*|v1.19.*/