-
Notifications
You must be signed in to change notification settings - Fork 1k
docs(scheduler): scheduler-extensibility #7044
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @CharlesQQ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 本 PR 提出了一个关于增强 Karmada 调度器可扩展性的设计提案。该提案旨在通过引入插件化机制和扩展 API,解决当前调度器在满足企业级定制化需求方面的局限性。核心思想是在不修改调度器核心代码的前提下,允许用户灵活地定义和实现复杂的调度策略,从而提升 Karmada 在多集群环境下的适应性和功能性。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
本提案为增强 Karmada 调度器的可扩展性提供了一个清晰的设计,通过引入 AdvancedScheduling 字段和新的 ReplicaSchedulingPlugin 扩展点,使得用户可以更灵活地定制调度策略。文档结构清晰,用户故事丰富。
我发现了一些可以改进的地方:
- “背景问题”部分内容缺失,建议补充以提供更完整的上下文。
- 故事5中的
PropagationPolicy示例缺少spec.replicas字段,并且其调度结果与描述不一致,可能会引起混淆。 - 从注解迁移到新API字段时,键名的命名规范发生了变化,建议在文档中明确说明,以提高清晰度。
这些修改将有助于提高提案的准确性和可读性。
| - **促销期间(50 副本)**: | ||
| - idc-self-cluster-1: 15 副本 | ||
| - idc-self-cluster-2: 15 副本 | ||
| - mixed-cloud-cluster: 50 副本(自动分配到 mixed 集群, 由子集群控制该副本数) |
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.
|
|
||
| ## 动机 (Motivation) | ||
|
|
||
| ### 背景问题 |
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.
| # PropagationPolicy 配置 | ||
| apiVersion: policy.karmada.io/v1alpha1 | ||
| kind: PropagationPolicy | ||
| metadata: | ||
| name: ecommerce-policy | ||
| annotations: | ||
| scheduler.karmada.io/replica-scheduling-strategy: | | ||
| { | ||
| "specifiedIdcs": [ | ||
| {"name": "idc-self", "replicas": 30} | ||
| ] | ||
| } | ||
| spec: | ||
| resourceSelectors: | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: ecommerce-app | ||
| placement: | ||
| clusterAffinity: | ||
| labelSelector: | ||
| matchLabels: | ||
| env: production | ||
| replicaScheduling: | ||
| replicaSchedulingType: Divided | ||
| ``` |
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.
| #### 示例 1:指定机房及副本数(specified-idcs) | ||
|
|
||
| ```yaml | ||
| apiVersion: policy.karmada.io/v1alpha1 | ||
| kind: PropagationPolicy | ||
| metadata: | ||
| name: core-service-policy | ||
| spec: | ||
| resourceSelectors: | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: core-service | ||
| placement: | ||
| clusterAffinity: | ||
| labelSelector: | ||
| matchLabels: | ||
| env: production | ||
| advancedScheduling: | ||
| specified-idcs: | ||
| - name: "idc-east" | ||
| replicas: 20 | ||
| - name: "idc-north" | ||
| replicas: 10 | ||
| ``` | ||
|
|
||
| #### 示例 2:指定集群及副本数(specified-clusters) | ||
|
|
||
| ```yaml | ||
| apiVersion: policy.karmada.io/v1alpha1 | ||
| kind: PropagationPolicy | ||
| metadata: | ||
| name: precise-allocation-policy | ||
| spec: | ||
| resourceSelectors: | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: my-app | ||
| advancedScheduling: | ||
| specified-clusters: | ||
| - name: "cluster-1" | ||
| replicas: 15 | ||
| - name: "cluster-2" | ||
| replicas: 10 | ||
| - name: "cluster-3" | ||
| replicas: 5 | ||
| ``` |
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7044 +/- ##
==========================================
- Coverage 46.62% 46.55% -0.07%
==========================================
Files 699 700 +1
Lines 48151 48091 -60
==========================================
- Hits 22450 22389 -61
- Misses 24013 24019 +6
+ Partials 1688 1683 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I can see a lot of interesting use cases. Will give it another look later. |
b4a4108 to
3be7291
Compare
a9e6f2b to
1d8dea9
Compare
Signed-off-by: chang.qiangqiang <[email protected]>
1d8dea9 to
a35b3bb
Compare
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: