众核混部抗干扰隔离与调度组件:通过实时采集与分析宿主机微架构级指标(LLC、PSI、I/O 延迟等),并结合 Volcano 调度插件与可选的 Kata 虚拟机隔离机制,规避底层共享资源竞争,旨在保障在线业务请求延迟 SLA 的同时提升集群整体混部密度。
Many-Core Orchestrator (MCO)
众核混部场景下的抗干扰隔离与调度优化组件。通过实时采集宿主机微架构指标(LLC Cache、I/O 延迟、PSI 压力),分析节点干扰等级,并驱动 Volcano 调度器进行干扰感知调度,同时提供 Kata Containers 虚拟机级隔离能力,降低在线业务延迟抖动、提升混部密度。
核心能力
- 干扰感知调度 — 基于 LLC Miss Rate、Bio Latency P99、PSI 等底层指标,实时评估节点干扰等级,调度时自动规避高干扰节点
- Kata 虚拟机隔离 — 自动化部署 Kata Containers 运行时,用户通过
runtimeClassName即可为离线负载启用虚拟机级隔离,物理切断微架构串扰 - 自动降级 — Analyzer 不可用或 CR 数据过期时,调度自动回退到基础模式,不阻断正常业务部署
- 可观测 — 各组件暴露 Prometheus
/metrics端点,支持 ServiceMonitor 自动发现
架构
flowchart TB
subgraph user["用户命名空间"]
pod["Pod<br/>runtimeClassName: runc | kata-*"]
end
subgraph mco["mco-system"]
collector["Collector<br/>(DaemonSet)"]
analyzer["Analyzer<br/>(Deployment)"]
kata["kata-deploy<br/>(DaemonSet)"]
end
subgraph volcano["volcano-system"]
scheduler["Volcano Scheduler<br/>+ mco-plugin"]
end
subgraph k8s["Kubernetes API"]
cr["NodeInterferenceReport CR<br/>(cluster-scoped)"]
end
pod -->|调度请求| scheduler
collector -->|gRPC 流式上报| analyzer
analyzer -->|写入干扰报告| cr
scheduler -->|informer 读取| cr
kata -.->|提供运行时能力| pod
数据流
flowchart LR
A["Collector<br/>指标采集"] -->|gRPC| B["Analyzer<br/>干扰分析"]
B -->|写入| C["NodeInterferenceReport CR"]
C -->|informer watch| D["mco-plugin<br/>Filter + Score"]
目录结构
many-core-orchestrator/
├── api/v1alpha1/ # CRD 类型定义
├── cmd/
│ ├── analyzer/ # Analyzer 入口
│ ├── collector/ # Collector 入口
│ └── plugin/ # Volcano 调度插件
├── internal/
│ ├── analyzer/ # 干扰分析引擎
│ ├── collector/ # 指标采集实现
│ ├── controller/ # DetectionRuleConfig controller
│ └── metrics/ # 共享指标类型定义
├── pkg/
│ ├── api/analyzerv1/ # Collector→Analyzer gRPC 接口
│ └── constant/ # 共享常量与标签定义
├── proto/ # Protobuf 定义
├── charts/many-core-orchestrator/ # Helm Chart
│ ├── charts/volcano/ # Volcano subchart
│ ├── charts/kata-deploy/ # Kata Containers subchart
│ └── templates/ # MCO 组件模板
├── build/ # Dockerfiles
└── Makefile
快速开始
前置条件
- Kubernetes 集群(推荐 1.24+)
- Helm 3.x
- 如需调度插件:Volcano 1.9.0(可由 Chart 自动安装)
- 如需 Kata 隔离:节点支持 KVM 虚拟化
一键部署(全功能)
helm dependency update charts/many-core-orchestrator
helm install mco charts/many-core-orchestrator \
--set volcano.enabled=true \
--set mcoPlugin.enabled=true
此命令将部署 Collector DaemonSet、Analyzer Deployment、Kata Deploy DaemonSet 以及带 MCO 调度插件的 Volcano Scheduler。
接入已有 Volcano
kubectl scale deploy -n volcano-system volcano-scheduler --replicas=0
helm install mco charts/many-core-orchestrator \
--set volcano.enabled=false \
--set mcoPlugin.enabled=true \
--set mcoPlugin.manageSchedulerConfig=false
需在已有 volcano-scheduler-configmap 中手动注册 mco-plugin。
按需启用
各子模块可独立开关:
# 仅部署 Kata 隔离
helm install mco charts/many-core-orchestrator \
--set collector.enabled=false \
--set analyzer.enabled=false \
--set mcoPlugin.enabled=false
# 仅部署采集与分析
helm upgrade mco charts/many-core-orchestrator \
--set collector.enabled=true \
--set analyzer.enabled=true
使用
干扰感知调度
部署完成后,调度器自动生效。所有通过 Volcano 调度的 Pod 将自动享受干扰感知能力:
- Filter:排除 PSI 压力过高的节点;需要 Kata 运行时时检查节点
kata-ready标签 - Score:干扰等级越低的节点得分越高,优先调度到健康节点
Kata 虚拟机隔离
为 Pod 指定 runtimeClassName 即可使用 Kata 运行时:
apiVersion: v1
kind: Pod
metadata:
name: etl-batch
spec:
runtimeClassName: kata-qemu
containers:
- name: job
image: example/etl:latest
可用运行时类型(kata-qemu、kata-clh(需x86架构机器) 等)由 kata-deploy 自动注册。
查看干扰报告
# 查看集群所有节点干扰等级
kubectl get nodeinterferencereports.mco.many-core.io cluster -o yaml
# 简写
kubectl get nir cluster -o yaml
配置
调度插件参数
在 volcano-scheduler-configmap 中配置:
- name: mco-plugin
arguments:
mco-plugin:
crName: "cluster"
crStatusTTLSeconds: 30
hardConstraints:
psiMemoryFullAvg10: 0.0
psiIoSomeAvg10Threshold: 20.0
fallbackWhenCROutdated: true
干扰检测规则
通过 ConfigMap mco-detection-rules 配置检测阈值和权重,Analyzer 每 30s 热加载。详见 values.yaml 中 analyzer.detectionRules 部分。
关键配置项
| 配置项 | 载体 | 说明 |
|---|---|---|
detection-rules |
ConfigMap | 干扰检测阈值和权重 |
mco-plugin 参数 |
volcano-scheduler-configmap |
调度 Filter/Score 参数 |
collector.analyzerAddr |
Helm values | Analyzer gRPC 地址 |
| Kata 节点标签 | Node label | katacontainers.io/kata-runtime |
可观测性
各组件暴露 Prometheus 指标端点:
| 组件 | 端口 | 关键指标 |
|---|---|---|
| Collector | 9877 | mco_node_cache_miss_rate、mco_node_bio_latency_p99_ms_raw、mco_node_psi_io_some_avg10_raw |
| Analyzer | 9878 | mco_node_interference_level、mco_analyzer_report_generation_duration_seconds |
Chart 默认创建 ServiceMonitor,支持 Prometheus Operator 自动发现。
构建
# 构建 Analyzer / Collector 镜像
docker build -f build/mco-analyzer.Dockerfile -t mco-analyzer:latest .
docker build -f build/mco-collector.Dockerfile -t mco-collector:latest .
# 构建调度器镜像(含插件)
docker build -f build/mco-volcano-scheduler.Dockerfile -t mco-volcano-scheduler:latest .
# 构建插件 .so(需 musl 工具链)
make build-plugin-so
开发
# 运行单元测试
go test ./...
# 构建诊断
make diagnostics
# 生成 protobuf stub(需 protoc + protoc-gen-go + protoc-gen-go-grpc)
protoc -I proto \
--go_out=. --go_opt=module=many-core-orchestrator \
--go-grpc_out=. --go-grpc_opt=module=many-core-orchestrator \
proto/analyzer/v1/analyzer.proto
许可
Mulan PSL v2