Merge pull request #35246 from yanrongshi/zh-cn]update-workloads.md
[zh-cn]update workloads/ _index.mdpull/35262/head
commit
92c8c8cfae
|
@ -25,10 +25,10 @@ a critical failure on the {{< glossary_tooltip text="node" term_id="node" >}} wh
|
||||||
Pod is running means that all the Pods on that node fail. Kubernetes treats that level
|
Pod is running means that all the Pods on that node fail. Kubernetes treats that level
|
||||||
of failure as final: you would need to create a new Pod even if the node later recovers.
|
of failure as final: you would need to create a new Pod even if the node later recovers.
|
||||||
-->
|
-->
|
||||||
无论你的负载是单一组件还是由多个一同工作的组件构成,在 Kubernetes 中你
|
在 Kubernetes 中,无论你的负载是由单个组件还是由多个一同工作的组件构成,
|
||||||
可以在一组 [Pods](/zh-cn/docs/concepts/workloads/pods) 中运行它。
|
你都可以在一组 [Pod](/zh-cn/docs/concepts/workloads/pods) 中运行它。
|
||||||
在 Kubernetes 中,Pod 代表的是集群上处于运行状态的一组
|
在 Kubernetes 中,Pod 代表的是集群上处于运行状态的一组
|
||||||
{{< glossary_tooltip text="容器" term_id="container" >}}。
|
{{< glossary_tooltip text="容器" term_id="container" >}} 的集合。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Kubernetes pods have a [defined lifecycle](/docs/concepts/workloads/pods/pod-lifecycle/).
|
Kubernetes pods have a [defined lifecycle](/docs/concepts/workloads/pods/pod-lifecycle/).
|
||||||
|
@ -37,11 +37,11 @@ For example, once a pod is running in your cluster then a critical fault on the
|
||||||
all the pods on that node fail. Kubernetes treats that level of failure as final: you
|
all the pods on that node fail. Kubernetes treats that level of failure as final: you
|
||||||
would need to create a new `Pod` to recover, even if the node later becomes healthy.
|
would need to create a new `Pod` to recover, even if the node later becomes healthy.
|
||||||
-->
|
-->
|
||||||
Kubernetes Pods 有[确定的生命周期](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/)。
|
Kubernetes Pods 遵循[预定义的生命周期](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/)。
|
||||||
例如,当某 Pod 在你的集群中运行时,Pod 运行所在的
|
例如,当在你的集群中运行了某个 Pod,但是 Pod 所在的
|
||||||
{{< glossary_tooltip text="节点" term_id="node" >}} 出现致命错误时,
|
{{< glossary_tooltip text="节点" term_id="node" >}} 出现致命错误时,
|
||||||
所有该节点上的 Pods 都会失败。Kubernetes 将这类失败视为最终状态:
|
所有该节点上的 Pods 的状态都会变成失败。Kubernetes 将这类失败视为最终状态:
|
||||||
即使该节点后来恢复正常运行,你也需要创建新的 Pod 来恢复应用。
|
即使该节点后来恢复正常运行,你也需要创建新的 Pod 以恢复应用。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
However, to make life considerably easier, you don't need to manage each Pod directly.
|
However, to make life considerably easier, you don't need to manage each Pod directly.
|
||||||
|
@ -52,10 +52,10 @@ you specified.
|
||||||
|
|
||||||
Kubernetes provides several built-in workload resources:
|
Kubernetes provides several built-in workload resources:
|
||||||
-->
|
-->
|
||||||
不过,为了让用户的日子略微好过一些,你并不需要直接管理每个 Pod。
|
不过,为了减轻用户的使用负担,通常不需要用户直接管理每个 Pod。
|
||||||
相反,你可以使用 _负载资源_ 来替你管理一组 Pods。
|
而是使用**负载资源**来替用户管理一组 Pod。
|
||||||
这些资源配置 {{< glossary_tooltip term_id="controller" text="控制器" >}}
|
这些负载资源通过配置 {{< glossary_tooltip term_id="controller" text="控制器" >}}
|
||||||
来确保合适类型的、处于运行状态的 Pod 个数是正确的,与你所指定的状态相一致。
|
来确保正确类型的、处于运行状态的 Pod 个数是正确的,与用户所指定的状态相一致。
|
||||||
|
|
||||||
Kubernetes 提供若干种内置的工作负载资源:
|
Kubernetes 提供若干种内置的工作负载资源:
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ Kubernetes 提供若干种内置的工作负载资源:
|
||||||
[ReplicaSet](/zh-cn/docs/concepts/workloads/controllers/replicaset/)
|
[ReplicaSet](/zh-cn/docs/concepts/workloads/controllers/replicaset/)
|
||||||
(替换原来的资源 {{< glossary_tooltip text="ReplicationController" term_id="replication-controller" >}})。
|
(替换原来的资源 {{< glossary_tooltip text="ReplicationController" term_id="replication-controller" >}})。
|
||||||
`Deployment` 很适合用来管理你的集群上的无状态应用,`Deployment` 中的所有
|
`Deployment` 很适合用来管理你的集群上的无状态应用,`Deployment` 中的所有
|
||||||
`Pod` 都是相互等价的,并且在需要的时候被换掉。
|
`Pod` 都是相互等价的,并且在需要的时候被替换。
|
||||||
* [StatefulSet](/zh-cn/docs/concepts/workloads/controllers/statefulset/)
|
* [StatefulSet](/zh-cn/docs/concepts/workloads/controllers/statefulset/)
|
||||||
让你能够运行一个或者多个以某种方式跟踪应用状态的 Pods。
|
让你能够运行一个或者多个以某种方式跟踪应用状态的 Pods。
|
||||||
例如,如果你的负载会将数据作持久存储,你可以运行一个 `StatefulSet`,将每个
|
例如,如果你的负载会将数据作持久存储,你可以运行一个 `StatefulSet`,将每个
|
||||||
|
@ -115,13 +115,12 @@ of Kubernetes' core. For example, if you wanted to run a group of `Pods` for you
|
||||||
stop work unless _all_ the Pods are available (perhaps for some high-throughput distributed task),
|
stop work unless _all_ the Pods are available (perhaps for some high-throughput distributed task),
|
||||||
then you can implement or install an extension that does provide that feature.
|
then you can implement or install an extension that does provide that feature.
|
||||||
-->
|
-->
|
||||||
在庞大的 Kubernetes 生态系统中,你还可以找到一些提供额外操作的第三方
|
在庞大的 Kubernetes 生态系统中,你还可以找到一些提供额外操作的第三方工作负载相关的资源。
|
||||||
工作负载资源。通过使用
|
通过使用[定制资源定义(CRD)](/zh-cn/docs/concepts/extend-kubernetes/api-extension/custom-resources/),
|
||||||
[定制资源定义(CRD)](/zh-cn/docs/concepts/extend-kubernetes/api-extension/custom-resources/),
|
|
||||||
你可以添加第三方工作负载资源,以完成原本不是 Kubernetes 核心功能的工作。
|
你可以添加第三方工作负载资源,以完成原本不是 Kubernetes 核心功能的工作。
|
||||||
例如,如果你希望运行一组 `Pods`,但要求所有 Pods 都可用时才执行操作
|
例如,如果你希望运行一组 `Pods`,但要求所有 Pods 都可用时才执行操作
|
||||||
(比如针对某种高吞吐量的分布式任务),你可以实现一个能够满足这一需求
|
(比如针对某种高吞吐量的分布式任务),你可以基于定制资源实现一个能够满足这一需求的扩展,
|
||||||
的扩展,并将其安装到集群中运行。
|
并将其安装到集群中运行。
|
||||||
|
|
||||||
## {{% heading "whatsnext" %}}
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
|
@ -136,8 +135,7 @@ As well as reading about each resource, you can learn about specific tasks that
|
||||||
除了阅读了解每类资源外,你还可以了解与这些资源相关的任务:
|
除了阅读了解每类资源外,你还可以了解与这些资源相关的任务:
|
||||||
|
|
||||||
* [使用 Deployment 运行一个无状态的应用](/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/)
|
* [使用 Deployment 运行一个无状态的应用](/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/)
|
||||||
* 以[单实例](/zh-cn/docs/tasks/run-application/run-single-instance-stateful-application/)
|
* 以[单实例](/zh-cn/docs/tasks/run-application/run-single-instance-stateful-application/)或者[多副本集合](/zh-cn/docs/tasks/run-application/run-replicated-stateful-application/)
|
||||||
或者[多副本集合](/zh-cn/docs/tasks/run-application/run-replicated-stateful-application/)
|
|
||||||
的形式运行有状态的应用;
|
的形式运行有状态的应用;
|
||||||
* [使用 `CronJob` 运行自动化的任务](/zh-cn/docs/tasks/job/automated-tasks-with-cron-jobs/)
|
* [使用 `CronJob` 运行自动化的任务](/zh-cn/docs/tasks/job/automated-tasks-with-cron-jobs/)
|
||||||
|
|
||||||
|
@ -145,8 +143,7 @@ As well as reading about each resource, you can learn about specific tasks that
|
||||||
To learn about Kubernetes' mechanisms for separating code from configuration,
|
To learn about Kubernetes' mechanisms for separating code from configuration,
|
||||||
visit [Configuration](/docs/concepts/configuration/).
|
visit [Configuration](/docs/concepts/configuration/).
|
||||||
-->
|
-->
|
||||||
要了解 Kubernetes 将代码与配置分离的实现机制,可参阅
|
要了解 Kubernetes 将代码与配置分离的实现机制,可参阅[配置部分](/zh-cn/docs/concepts/configuration/)。
|
||||||
[配置部分](/zh-cn/docs/concepts/configuration/)。
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
There are two supporting concepts that provide backgrounds about how Kubernetes manages pods
|
There are two supporting concepts that provide backgrounds about how Kubernetes manages pods
|
||||||
|
@ -160,8 +157,8 @@ for applications:
|
||||||
|
|
||||||
* [垃圾收集](/zh-cn/docs/concepts/architecture/garbage-collection/)机制负责在
|
* [垃圾收集](/zh-cn/docs/concepts/architecture/garbage-collection/)机制负责在
|
||||||
对象的 _属主资源_ 被删除时在集群中清理这些对象。
|
对象的 _属主资源_ 被删除时在集群中清理这些对象。
|
||||||
* [_Time-to-Live_ 控制器](/zh-cn/docs/concepts/workloads/controllers/ttlafterfinished/)
|
* [**Time-to-Live** 控制器](/zh-cn/docs/concepts/workloads/controllers/ttlafterfinished/)会在 Job
|
||||||
会在 Job 结束之后的指定时间间隔之后删除它们。
|
结束之后的指定时间间隔之后删除它们。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Once your application is running, you might want to make it available on the internet as
|
Once your application is running, you might want to make it available on the internet as
|
||||||
|
|
Loading…
Reference in New Issue