wusamzong commented on code in PR #348:
URL: https://github.com/apache/yunikorn-site/pull/348#discussion_r1356458529


##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方

Review Comment:
   在Kubernetes上,原始的作法是将YuniKorn当作Kubernetes调度器从零开始实现的。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,

Review Comment:
   可以用来编译为Kubernetes调度器,其中包含YuniKorn功能以及默认调度器功能



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。

Review Comment:
   理想情况下,我们应该能够自动地支援新的Kubernetes发布版本,并受益于新功能。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。

Review Comment:
   将为调度器建构分别两种Docker镜像:



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:

Review Comment:
   包括



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。

Review Comment:
   当Pod在Kuberenetes中被删除时,也將调度器缓存中的Pod删除。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现

Review Comment:
   插件模式的实现



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现
+
+为了暴露 YuniKorn 的全部功能,我们实现了三个调度框架插件:
+
+### PreFilter
+
+PreFilter 插件被传入一个 Pod 的引用,并根据是否应该考虑该 Pod 进行调度,返回 `Success` 或 `Unschedulable`。
+
+对于 YuniKorn 的实现,我们首先检查 Pod 是否有关联的 `applicationId` 定义。如果没有,我们立即返回 `Success`,

Review Comment:
   我们首先检查 Pod 是否定义 `applicationId` 



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现
+
+为了暴露 YuniKorn 的全部功能,我们实现了三个调度框架插件:
+
+### PreFilter
+
+PreFilter 插件被传入一个 Pod 的引用,并根据是否应该考虑该 Pod 进行调度,返回 `Success` 或 `Unschedulable`。
+
+对于 YuniKorn 的实现,我们首先检查 Pod 是否有关联的 `applicationId` 定义。如果没有,我们立即返回 `Success`,
+这允许我们将非批处理工作负载委托给默认调度器。
+
+如果存在 `applicationId`,则确定是否存在待处理的 Pod 分配(表示 YuniKorn core 已经决定分配该 Pod)。
+如果存在待处理的 Pod 分配,我们返回 `Success`,否则返回 `Unschedulable`。
+此外,如果检测到正在进行的分配(表示我们先前尝试过调度该 Pod),我们触发一个 `RejectTask` 事件给 YuniKorn core,
+以便稍后重新发送该 Pod 进行调度。
+
+### Filter
+
+Filter 插件用于过滤无法运行 Pod 的节点。只有在 PreFilter 阶段通过的 Pod 才会进行评估。
+
+对于 YuniKorn 插件,我们遵循类似 PreFilter 的逻辑,但我们还验证待处理的 Pod 分配是否与 YuniKorn 选择的节点匹配。

Review Comment:
   我们还验证「待處理的Pod分配」的节点是否与 YuniKorn 选择的节点匹配。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。

Review Comment:
   理想情况下,我们应该能够自动地支援新的Kubernetes发布版本,并受益于新功能。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方

Review Comment:
   在Kubernetes上,原始的作法是将YuniKorn当作Kubernetes调度器从零开始实现的。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,

Review Comment:
   可以用来编译为Kubernetes调度器,其中包含YuniKorn功能以及默认调度器功能



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。

Review Comment:
   将为调度器建构分别两种Docker镜像:



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。

Review Comment:
   当Pod在Kuberenetes中被删除时,也將调度器缓存中的Pod删除。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:

Review Comment:
   包括



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现
+
+为了暴露 YuniKorn 的全部功能,我们实现了三个调度框架插件:
+
+### PreFilter
+
+PreFilter 插件被传入一个 Pod 的引用,并根据是否应该考虑该 Pod 进行调度,返回 `Success` 或 `Unschedulable`。
+
+对于 YuniKorn 的实现,我们首先检查 Pod 是否有关联的 `applicationId` 定义。如果没有,我们立即返回 `Success`,

Review Comment:
   我们首先检查 Pod 是否定义 `applicationId` 



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现
+
+为了暴露 YuniKorn 的全部功能,我们实现了三个调度框架插件:
+
+### PreFilter
+
+PreFilter 插件被传入一个 Pod 的引用,并根据是否应该考虑该 Pod 进行调度,返回 `Success` 或 `Unschedulable`。
+
+对于 YuniKorn 的实现,我们首先检查 Pod 是否有关联的 `applicationId` 定义。如果没有,我们立即返回 `Success`,
+这允许我们将非批处理工作负载委托给默认调度器。
+
+如果存在 `applicationId`,则确定是否存在待处理的 Pod 分配(表示 YuniKorn core 已经决定分配该 Pod)。
+如果存在待处理的 Pod 分配,我们返回 `Success`,否则返回 `Unschedulable`。
+此外,如果检测到正在进行的分配(表示我们先前尝试过调度该 Pod),我们触发一个 `RejectTask` 事件给 YuniKorn core,
+以便稍后重新发送该 Pod 进行调度。
+
+### Filter
+
+Filter 插件用于过滤无法运行 Pod 的节点。只有在 PreFilter 阶段通过的 Pod 才会进行评估。
+
+对于 YuniKorn 插件,我们遵循类似 PreFilter 的逻辑,但我们还验证待处理的 Pod 分配是否与 YuniKorn 选择的节点匹配。

Review Comment:
   我们还验证「待處理的Pod分配」的节点是否与 YuniKorn 选择的节点匹配。



##########
i18n/zh-cn/docusaurus-plugin-content-docs/current/design/scheduler_plugin.md:
##########
@@ -0,0 +1,89 @@
+---
+id: scheduler_plugin
+title: K8s 调度器插件
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+
+## 背景
+
+YuniKorn (在Kubernetes上) 通常作为一个重头开始实现的 Kubernetes 调度器。这使我们能够快创新,但也存在问题。我们目前有许多地方
+调用非公开的 K8S 源代码API,这些API的稳定性各不相同,当我们切换到新的 Kubernetes 版本时,需要进行破坏性的代码更动。
+
+理想情况下, 我们应该能够自动利用新的 Kubernetes 版本的增强功能。使用插件模式可以增强 Kubernetes 版本的兼容性,减少工作量。
+此外,在许多情况下,允许非批次处理工作负载绕过 YuniKorn 调度功能并使用默认调度逻辑是可取的。然而,我们目前无法做到这一点,因为 
+YuniKorn 调度器二进制文件中没有默认的调度功能。自 Kubernetes 1.19 版本以来,Kubernetes 项目已经创建了一个稳定的 API 
+用于[调度框架](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/),
+允许创建实现各种扩展点的插件。插件实现一个或多个这些扩展点,然后编译为调度器的二进制文件,其中包含默认调度器和差件代码,
+并在正常调度流程中调用插件。
+
+## 设计
+
+我们在 k8s-shim 代码库中添加了一个调度气插件,可以用于建构包含 YuniKorn 功能以及目任调度气功腾的 Kubernetes 调度器二进制文件,
+显著高 YuniKorn 与 Kubernetes 的兼容性,并有更大的信心将 YuniKorn 部署为集群中唯一的调度器。为调度器创建了单独的 
Docker 镜像。
+传统的 YuniKorn 调度器构建为 `scheduler-{version}`,而新的插件版本构建为 
`scheduler-plugin-{version}`。可以通过自定义调度器镜像
+来交替部署它们到 Kubernetes 集群中,使用相同的 Helm charts 进行部署。
+
+## 入口点
+
+现有的 shim `main()` 方法已经被移动到 `pkg/cmd/shim/main.go`,并创建了一个新的 `main()` 方法在 
+`pkg/cmd/schedulerplugin/main.go` 之下。该方法实例化默认的 Kubernetes 调度器,并将 YuniKorn 
作为一组插件添加到其中。
+它还修改了默认调度气器的 CLI 参数解析,以添加 YuniKorn 特定的选项。创建 YuniKorn 插件时,它将在后台启动现有的 shim / 
core 调度器,
+同步所有的 informer, 并启动正常的 YuniKorn 调度循环。
+
+## Shim 调度器更改
+
+为了与默认调度器合作,当处于插件模式时,shim 需要稍微不同地操作。这些差异报括:
+
+- 在 `postTaskAllocated()` 中,我们实际上不会绑定 Pod 或 Volumes,因为这是默认调度器框架的责任。
+  相反,我们在内部映射中跟踪 YK 为节点分配的节点,分派一个新的 BindTaskEvent,并在 Pod 上记录一个 `QuotaApproved` 
事件。
+- 在 `postTaskBound()` 中,我们将 Pod 的状态更新为 `QuotaApproved`,因为这将导致默认调度器重新评估 Pod 
的调度(更多细节见下文)。
+- 在调度器缓存中,我们跟踪待处理和进行中的 Pod 分配,并在从缓存中删除 Pod 时将它们删除。
+
+
+## 插件实现

Review Comment:
   插件模式的实现



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to