[zh] Tidy up and fix links in tasks section (7/10)
This commit is contained in:
@@ -1,52 +1,46 @@
|
||||
---
|
||||
reviewers:
|
||||
- luxas
|
||||
- thockin
|
||||
- wlan0
|
||||
title: 开发云控制器管理器
|
||||
content_type: concept
|
||||
content_type: task
|
||||
---
|
||||
|
||||
<!--
|
||||
---
|
||||
reviewers:
|
||||
- luxas
|
||||
- thockin
|
||||
- wlan0
|
||||
title: Developing Cloud Controller Manager
|
||||
content_type: concept
|
||||
---
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
|
||||
<!--
|
||||
In upcoming releases, Cloud Controller Manager will
|
||||
be the preferred way to integrate Kubernetes with any cloud. This will ensure cloud providers
|
||||
can develop their features independently from the core Kubernetes release cycles.**
|
||||
-->
|
||||
在即将发布的版本中,云控制器管理器将是把 Kubernetes 与任何云集成的首选方式。 这将确保驱动可以独立于核心 Kubernetes 发布周期开发其功能。
|
||||
|
||||
{{< feature-state for_k8s_version="1.8" state="alpha" >}}
|
||||
|
||||
<!--
|
||||
Before going into how to build your own cloud controller manager, some background on how it works under the hood is helpful. The cloud controller manager is code from `kube-controller-manager` utilizing Go interfaces to allow implementations from any cloud to be plugged in. Most of the scaffolding and generic controller implementations will be in core, but it will always exec out to the cloud interfaces it is provided, so long as the [cloud provider interface](https://github.com/kubernetes/cloud-provider/blob/master/cloud.go#L42-L62) is satisfied.
|
||||
-->
|
||||
在讨论如何构建自己的云控制器管理器之前,了解有关它如何工作的一些背景知识是有帮助的。云控制器管理器是来自 `kube-controller-manager` 的代码,利用 Go 接口允许插入任何云的实现。大多数框架和通用控制器的实现在 core,但只要满足 [云提供者接口](https://github.com/kubernetes/cloud-provider/blob/master/cloud.go#L42-L62),它就会始终执行它所提供的云接口。
|
||||
|
||||
<!--
|
||||
To dive a little deeper into implementation details, all cloud controller managers will import packages from Kubernetes core, the only difference being each project will register their own cloud providers by calling [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/cloud-provider/blob/master/plugins.go#L56-L66) where a global variable of available cloud providers is updated.
|
||||
-->
|
||||
为了深入了解实施细节,所有云控制器管理器都将从 Kubernetes 核心导入依赖包,唯一的区别是每个项目都会通过调用 [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/cloud-provider/blob/master/plugins.go#L56-L66) 来注册自己的驱动,更新可用驱动的全局变量。
|
||||
|
||||
|
||||
|
||||
{{< glossary_definition term_id="cloud-controller-manager" length="all" prepend="组件 cloud-controller-manager 是">}}
|
||||
|
||||
<!-- body -->
|
||||
|
||||
<!--
|
||||
## Background
|
||||
|
||||
Since cloud providers develop and release at a different pace compared to the Kubernetes project, abstracting the provider-specific code to the `cloud-controller-manager` binary allows cloud vendors to evolve independently from the core Kubernetes code.
|
||||
-->
|
||||
## 背景
|
||||
|
||||
由于云驱动的开发和发布与 Kubernetes 项目本身步调不同,将特定于云环境
|
||||
的代码抽象到 `cloud-controller-manager` 二进制组件有助于云厂商独立于
|
||||
Kubernetes 核心代码推进其驱动开发。
|
||||
|
||||
<!--
|
||||
The Kubernetes project provides skeleton cloud-controller-manager code with Go interfaces to allow you (or your cloud provider) to plug in your own implementations. This means that a cloud provider can implement a cloud-controller-manager by importing packages from Kubernetes core; each cloudprovider will register their own code by calling `cloudprovider.RegisterCloudProvider` to update a global variable of available cloud providers.
|
||||
-->
|
||||
Kubernetes 项目提供 cloud-controller-manager 的框架代码,其中包含 Go
|
||||
语言的接口,便于你(或者你的云驱动提供者)接驳你自己的实现。
|
||||
这意味着每个云驱动可以通过从 Kubernetes 核心代码导入软件包来实现一个
|
||||
cloud-controller-manager;每个云驱动会通过调用
|
||||
`cloudprovider.RegisterCloudProvider` 接口来注册其自身实现代码,从而更新
|
||||
记录可用云驱动的全局变量。
|
||||
|
||||
<!--
|
||||
## Developing
|
||||
-->
|
||||
@@ -57,28 +51,35 @@ To dive a little deeper into implementation details, all cloud controller manage
|
||||
<!--
|
||||
To build an out-of-tree cloud-controller-manager for your cloud, follow these steps:
|
||||
-->
|
||||
要为您的云构建一个 out-of-tree 云控制器管理器,请按照下列步骤操作:
|
||||
要为你的云环境构建一个 out-of-tree 云控制器管理器:
|
||||
|
||||
<!--
|
||||
1. Create a go package with an implementation that satisfies [cloudprovider.Interface](https://git.k8s.io/kubernetes/pkg/cloudprovider/cloud.go).
|
||||
2. Use [main.go in cloud-controller-manager](https://github.com/kubernetes/kubernetes/blob/master/cmd/cloud-controller-manager/controller-manager.go) from Kubernetes core as a template for your main.go. As mentioned above, the only difference should be the cloud package that will be imported.
|
||||
3. Import your cloud package in `main.go`, ensure your package has an `init` block to run [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/plugins.go#L42-L52).
|
||||
-->
|
||||
1. 使用满足 [cloudprovider.Interface](https://git.k8s.io/kubernetes/pkg/cloudprovider/cloud.go) 的实现创建一个 go 包。
|
||||
2. 使用来自 Kubernetes 核心包的 [cloud-controller-manager 中的 main.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/cloud-controller-manager/controller-manager.go) 作为 main.go 的模板。如上所述,唯一的区别应该是将导入的云包。
|
||||
1. 使用满足 [cloudprovider.Interface](https://git.k8s.io/kubernetes/pkg/cloudprovider/cloud.go)
|
||||
的实现创建一个 Go 语言包。
|
||||
2. 使用来自 Kubernetes 核心代码库的
|
||||
[cloud-controller-manager 中的 main.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/cloud-controller-manager/controller-manager.go)
|
||||
作为 main.go 的模板。如上所述,唯一的区别应该是将导入的云包。
|
||||
3. 在 `main.go` 中导入你的云包,确保你的包有一个 `init` 块来运行 cloudprovider.RegisterCloudProvider。
|
||||
|
||||
<!--
|
||||
Using existing out-of-tree cloud providers as an example may be helpful. You can find the list [here](/docs/tasks/administer-cluster/running-cloud-controller.md#examples).
|
||||
Many cloud providers publish their controller manager code as open source. If you are creating
|
||||
a new cloud-controller-manager from scratch, you could take an existing out-of-tree cloud
|
||||
controller manager as your starting point.
|
||||
-->
|
||||
用现有的 out-of-tree 云驱动作为例子可能会有所帮助。你可以在这里找到 [清单](/docs/tasks/administer-cluster/running-cloud-controller.md#examples)。
|
||||
|
||||
很多云驱动都将其控制器管理器代码以开源代码的形式公开。
|
||||
如果你在开发一个新的 cloud-controller-manager,你可以选择某个 out-of-tree
|
||||
云控制器管理器作为出发点。
|
||||
|
||||
### In Tree
|
||||
|
||||
<!--
|
||||
For in-tree cloud providers, you can run the in-tree cloud controller manager as a [Daemonset](/examples/admin/cloud/ccm-example.yaml) in your cluster. See the [running cloud controller manager docs](/docs/tasks/administer-cluster/running-cloud-controller.md) for more details.
|
||||
For in-tree cloud providers, you can run the in-tree cloud controller manager as a {{< glossary_tooltip term_id="daemonset" >}} in your cluster. See [Cloud Controller Manager Administration](/docs/tasks/administer-cluster/running-cloud-controller/) for more details.
|
||||
-->
|
||||
对于 in-tree 驱动,您可以将 in-tree 云控制器管理器作为群集中的 [Daemonset](/examples/admin/cloud/ccm-example.yaml) 运行。有关详细信息,请参阅 [运行的云控制器管理器文档](/docs/tasks/administer-cluster/running-cloud-controller.md)。
|
||||
|
||||
对于 in-tree 驱动,你可以将 in-tree 云控制器管理器作为群集中的
|
||||
{{< glossary_tooltip term_id="daemonset" text="Daemonset" >}} 来运行。
|
||||
有关详细信息,请参阅[云控制器管理器管理](/zh/docs/tasks/administer-cluster/running-cloud-controller/)。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user