运行 Sandbox
将 Kueue 与 Sandbox Operator 集成。
此页面展示了在运行 Sandbox 时, 如何利用 Kueue 的调度和资源管理能力。
本指南适用于对 Kueue 有基本了解的批处理用户。 欲了解更多,请参阅 Kueue 概述。
Sandbox Operator 为运行 AI Agent 工作负载提供隔离环境。 Kueue 通过 Plain Pod 集成来管理 Sandbox 控制器创建的 Pod, 其中每个 Sandbox Pod 都会表现为一个独立的 Plain Pod。
开始之前
-
学习如何安装具有自定义管理器配置的 Kueue。
-
按照运行 Plain Pod 中的步骤学习如何启用和配置
pod集成。 -
查看管理员集群配额以获取初始 Kueue 设置的详细信息。
-
安装 Sandbox Operator。
Sandbox 定义
a. 选择队列
目标本地队列应在 Sandbox 配置的
spec.podTemplate.metadata.labels 部分中指定。
spec:
podTemplate:
metadata:
labels:
kueue.x-k8s.io/queue-name: user-queue
b. 配置资源需求
工作负载的资源需求可以在 spec.podTemplate.spec.containers 中配置。
spec:
podTemplate:
spec:
containers:
- resources:
requests:
cpu: "100m"
memory: "200Mi"
Sandbox 示例
下面是一个 Sandbox 示例:
apiVersion: agents.x-k8s.io/v1alpha1
kind: Sandbox
metadata:
name: hello-world-kueue
spec:
podTemplate:
metadata:
labels:
kueue.x-k8s.io/queue-name: user-queue
spec:
containers:
- name: hello
image: busybox
command: ["sleep"]
args: ["6000"]
resources:
requests:
cpu: "100m"
memory: "200Mi"
restartPolicy: Never
限制
- Kueue 只会管理由 Sandbox Operator 创建的 Pod。
- 每个 Sandbox Pod 都会创建一个新的 Workload 资源,并且必须等待 Kueue 准入。
反馈
这个页面有帮助吗?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.