@@ -3,3 +3,116 @@ title: "工作负载"
3
3
weight : 50
4
4
description : 理解 Pods,Kubernetes 中可部署的最小计算对象,以及辅助它运行它们的高层抽象对象。
5
5
---
6
+
7
+ <!--
8
+ title: "Workloads"
9
+ weight: 50
10
+ description: >
11
+ Understand Pods, the smallest deployable compute object in Kubernetes, and the higher-level abstractions that help you to run them.
12
+ no_list: true
13
+ -->
14
+
15
+ {{< glossary_definition term_id="workload" length="short" >}}
16
+
17
+ <!--
18
+ Whether your workload is a single component or several that work together, on Kubernetes you run
19
+ it inside a set of [Pods](/docs/concepts/workloads/pods).
20
+ In Kubernetes, a Pod represents a set of running {{< glossary_tooltip text="containers" term_id="container" >}}
21
+ on your cluster.
22
+
23
+ A Pod has a defined lifecycle. For example, once a Pod is running in your cluster then
24
+ a critical failure on the {{< glossary_tooltip text="node" term_id="node" >}} where that
25
+ Pod is running means that all the Pods on that node fail. Kubernetes treats that level
26
+ of failure as final: you would need to create a new Pod even if the node later recovers.
27
+ -->
28
+ 无论你的负载是单一组件还是由多个一同工作的组件构成,在 Kubernetes 中你
29
+ 可以在一组 [ Pods] ( /zh/docs/concepts/workloads/pods ) 中运行它。
30
+ 在 Kubernetes 中,Pod 代表的是集群上处于运行状态的一组
31
+ {{< glossary_tooltip text="容器" term_id="container" >}}。
32
+
33
+ Pod 有确定的生命周期。例如,一旦某 Pod 在你的集群中运行,Pod 运行所在的
34
+ {{< glossary_tooltip text="节点" term_id="node" >}} 出现致命错误时,
35
+ 所有该节点上的 Pods 都会失败。Kubernetes 将这类失败视为最终状态:
36
+ 即使节点后来恢复正常运行,你也需要创建新的 Pod。
37
+
38
+ <!--
39
+ However, to make life considerably easier, you don't need to manage each Pod directly.
40
+ Instead, you can use _workload resources_ that manage a set of Pods on your behalf.
41
+ These resources configure {{< glossary_tooltip term_id="controller" text="controllers" >}}
42
+ that make sure the right number of the right kind of Pod are running, to match the state
43
+ you specified.
44
+
45
+ Those workload resources include:
46
+ -->
47
+ 不过,为了让用户的日子略微好过一些,你并不需要直接管理每个 Pod。
48
+ 相反,你可以使用 _ 负载资源_ 来替你管理一组 Pods。
49
+ 这些资源配置 {{< glossary_tooltip term_id="controller" text="控制器" >}}
50
+ 来确保合适类型的、处于运行状态的 Pod 个数是正确的,与你所指定的状态相一致。
51
+
52
+ 这些工作负载资源包括:
53
+
54
+ <!--
55
+ * [Deployment](/docs/concepts/workloads/controllers/deployment/) and [ReplicaSet](/docs/concepts/workloads/controllers/replicaset/)
56
+ (replacing the legacy resource {{< glossary_tooltip text="ReplicationController" term_id="replication-controller" >}});
57
+ * [StatefulSet](/docs/concepts/workloads/controllers/statefulset/);
58
+ * [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) for running Pods that provide
59
+ node-local facilities, such as a storage driver or network plugin;
60
+ * [Job](/docs/concepts/workloads/controllers/job/) and
61
+ [CronJob](/docs/concepts/workloads/controllers/cron-jobs/)
62
+ for tasks that run to completion.
63
+ -->
64
+ * [ Deployment] ( /zh/docs/concepts/workloads/controllers/deployment/ ) 和
65
+ [ ReplicaSet] ( /zh/docs/concepts/workloads/controllers/replicaset/ )
66
+ (替换原来的资源 {{< glossary_tooltip text="ReplicationController" term_id="replication-controller" >}});
67
+ * [ StatefulSet] ( /zh/docs/concepts/workloads/controllers/statefulset/ ) ;
68
+ * 用来运行提供节点本地支撑设施(如存储驱动或网络插件)的 Pods 的
69
+ [ DaemonSet] ( /zh/docs/concepts/workloads/controllers/daemonset/ ) ;
70
+ * 用来执行运行到结束为止的
71
+ [ Job] ( /zh/docs/concepts/workloads/controllers/job/ ) 和
72
+ [ CronJob] ( /zh/docs/concepts/workloads/controllers/cron-jobs/ ) 。
73
+
74
+ <!--
75
+ There are also two supporting concepts that you might find relevant:
76
+ * [Garbage collection](/docs/concepts/workloads/controllers/garbage-collection/) tidies up objects
77
+ from your cluster after their _owning resource_ has been removed.
78
+ * The [_time-to-live after finished_ controller](/docs/concepts/workloads/controllers/ttlafterfinished/)
79
+ removes Jobs once a defined time has passed since they completed.
80
+ -->
81
+ 你可能发现还有两种支撑概念很有用:
82
+
83
+ * [ 垃圾收集] ( /zh/docs/concepts/workloads/controllers/garbage-collection/ ) 机制负责在
84
+ 对象的 _ 属主资源_ 被删除时在集群中清理这些对象。
85
+ * [ _ 结束后存在时间_ 控制器] ( /zh/docs/concepts/workloads/controllers/ttlafterfinished/ )
86
+ 会在 Job 结束之后的指定时间间隔之后删除它们。
87
+
88
+ ## {{% heading "whatsnext" %}}
89
+
90
+ <!--
91
+ As well as reading about each resource, you can learn about specific tasks that relate to them:
92
+
93
+ * [Run a stateless application using a Deployment](/docs/tasks/run-application/run-stateless-application-deployment/)
94
+ * Run a stateful application either as a [single instance](/docs/tasks/run-application/run-single-instance-stateful-application/)
95
+ or as a [replicated set](/docs/tasks/run-application/run-replicated-stateful-application/)
96
+ * [Run Automated Tasks with a CronJob](/docs/tasks/job/automated-tasks-with-cron-jobs/)
97
+ -->
98
+ 除了阅读了解每类资源外,你还可以了解与这些资源相关的任务:
99
+
100
+ * [ 使用 Deployment 运行一个无状态的应用] ( /zh/docs/tasks/run-application/run-stateless-application-deployment/ )
101
+ * 以[ 单实例] ( /zh/docs/tasks/run-application/run-single-instance-stateful-application/ )
102
+ 或者[ 多副本集合] ( /zh/docs/tasks/run-application/run-replicated-stateful-application/ )
103
+ 的形式运行有状态的应用;
104
+ * [ 使用 CronJob 运行自动化的任务] ( /zh/docs/tasks/job/automated-tasks-with-cron-jobs/ )
105
+
106
+ <!--
107
+ Once your application is running, you might want to make it available on the internet as
108
+ a [Service](/docs/concepts/services-networking/service/) or, for web application only,
109
+ using an [Ingress](/docs/concepts/services-networking/ingress).
110
+
111
+ You can also visit [Configuration](/docs/concepts/configuration/) to learn about Kubernetes'
112
+ mechanisms for separating code from configuration.
113
+ -->
114
+ 一旦你的应用处于运行状态,你就可能想要
115
+ 以[ 服务] ( /zh/docs/concepts/services-networking/service/ )
116
+ 使之在互联网上可访问;或者对于 Web 应用而言,使用
117
+ [ Ingress] ( /docs/concepts/services-networking/ingress ) 资源将其暴露到互联网上。
118
+
0 commit comments