-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support scheduling framework #148
Closed
TheBeatles1994
wants to merge
1
commit into
alibaba:main
from
TheBeatles1994:support-scheduling-framework
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Open-Local Scheduling Framework | ||
|
||
## Local Plugin | ||
|
||
### 结构体定义 | ||
|
||
cache 维护一个表 | ||
|
||
- node | ||
- 存储池数组 | ||
- 存储类型(目前仅支持 LVM 类型) | ||
- 总量/使用量 | ||
- 持久卷信息 | ||
- 临时卷信息 | ||
|
||
### Local Plugin 初始化 | ||
|
||
设置 [nls](../api/nls_zh_CN.md) event handler 事件 | ||
|
||
- add | ||
- 创建 cache 中的 node 和 存储池 allocatable | ||
- update | ||
- 更新 cache 中的 node 和 存储池 allocatable | ||
|
||
设置完毕后同步 nls,等待其 Factory.WaitForCacheSync 同步完毕后,设置 pv/pod handler。 | ||
|
||
设置 pv event handler 事件:处理持久卷 | ||
|
||
- add | ||
- cache同步:获取环境中 **Bound** 状态的 PV 信息,并更新 cache 中对应的存储池信息 | ||
- 新PV:对于动态创建的 PV,此时 PV 状态为 **Pending**,则只需更新 cache 中的存储卷信息(调度器Reserve阶段已经添加除 PV 信息以外的 cache 信息,Reserve阶段 PV 还没有创建) | ||
- update | ||
- PV扩容:更新 cache 中对应存储池信息 | ||
- delete | ||
- 扣除 cache 中存储池对应使用量 | ||
- 删除 cache 中存储池 pv 信息 | ||
|
||
设置 pod event handler 事件:处理临时卷 | ||
|
||
- add | ||
- cache同步:获取环境中 assigned 的 Pod(nodeName不为空),并更新 cache 中对应的存储池信息 | ||
- 新Pod:不需更新cache(reserve阶段已更新cache) | ||
- delete | ||
- 删除 cache 中对应使用量 | ||
- 删除 cache 中临时卷信息 | ||
|
||
### Filter | ||
|
||
对于新 pod,根据其 pvc/临时卷信息 获取申请的存储量,然后判断节点存储池是否满足要求。 | ||
|
||
对于 Snapshot/Clone,判断存储池是否满足要求,同时过滤掉其他节点。 | ||
|
||
### Score | ||
|
||
对于新 pod,根据其 pvc/临时卷信息 获取申请的存储量,并打分。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 打分这里,是不是会存在binpack和spread两种策略? |
||
|
||
### Reserve | ||
|
||
- 获取使用的该节点的存储池名称 | ||
- 更新 cache 中的 存储池 使用量 | ||
- 更新 cache 中存储池的持久卷/临时卷信息 | ||
- 更新 nls annotation: 持久卷 与 存储池 的映射关系 | ||
|
||
若为快照,则不需要如上操作,详见[快照设计](../design/pv-snapshot.md)。 | ||
|
||
### Unreserve | ||
|
||
- 扣掉 cache 中的 存储池 使用量 | ||
- 删除 nls annotation 中 持久卷 与 存储池 映射关系 | ||
|
||
若为快照,则不需要如上操作。 | ||
|
||
## CSI | ||
|
||
### CreateVolume | ||
|
||
移除之前的 CSI -> scheduler extender 回调过程 | ||
|
||
- 根据 PV 对应的 PVC 信息获取调度节点名称(pvc annotation:volume.kubernetes.io/selected-node) | ||
- 获取对应节点的 nls | ||
- 从 nls 上获取存储池信息 | ||
- 删除 nls annotation 中 持久卷 与 存储池 映射关系 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要明确一下。对于nls annotation中的 持久卷 与 存储池 映射关系,这个中间状态是否需要cache。