Skip to content

Commit edba512

Browse files
authored
Merge pull request #37923 from gaogao101/work37
[zh] sync concepts/containers/_index.md
2 parents d678ae4 + f14f693 commit edba512

File tree

1 file changed

+31
-14
lines changed
  • content/zh-cn/docs/concepts/containers

1 file changed

+31
-14
lines changed

content/zh-cn/docs/concepts/containers/_index.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: "容器"
33
weight: 40
44
description: 打包应用及其运行依赖环境的技术。
55
content_type: concept
6-
no_list: true
76
---
87

98
<!-- overview -->
@@ -14,13 +13,22 @@ run it.
1413
1514
Containers decouple applications from underlying host infrastructure.
1615
This makes deployment easier in different cloud or OS environments.
16+
17+
Each {{< glossary_tooltip text="node" term_id="node" >}} in a Kubernetes
18+
cluster runs the containers that form the
19+
[Pods](/docs/concepts/workloads/pods/) assigned to that node.
20+
Containers in a Pod are co-located and co-scheduled to run on the same node.
1721
-->
1822
每个运行的容器都是可重复的;
1923
包含依赖环境在内的标准,意味着无论你在哪里运行它都会得到相同的行为。
2024

2125
容器将应用程序从底层的主机设施中解耦。
2226
这使得在不同的云或 OS 环境中部署更加容易。
2327

28+
Kubernetes 集群中的每个{{< glossary_tooltip text="节点" term_id="node" >}}都会运行容器,
29+
这些容器构成分配给该节点的 [Pod](/zh-cn/docs/concepts/workloads/pods/)
30+
单个 Pod 中的容器会在共同调度下,于同一位置运行在相同的节点上。
31+
2432
<!-- body -->
2533
<!--
2634
## Container images
@@ -29,31 +37,40 @@ software package, containing everything needed to run an application:
2937
the code and any runtime it requires, application and system libraries,
3038
and default values for any essential settings.
3139
32-
By design, a container is immutable: you cannot change the code of a
33-
container that is already running. If you have a containerized application
34-
and want to make changes, you need to build a new image that includes
35-
the change, then recreate the container to start from the updated image.
40+
Containers are intended to be stateless and
41+
[immutable](https://glossary.cncf.io/immutable-infrastructure/):
42+
you should not change
43+
the code of a container that is already running. If you have a containerized
44+
application and want to make changes, the correct process is to build a new
45+
image that includes the change, then recreate the container to start from the
46+
updated image.
3647
-->
3748

3849
## 容器镜像 {#container-images}
3950
[容器镜像](/zh-cn/docs/concepts/containers/images/)是一个随时可以运行的软件包,
4051
包含运行应用程序所需的一切:代码和它需要的所有运行时、应用程序和系统库,以及一些基本设置的默认值。
4152

42-
根据设计,容器是不可变的:你不能更改已经运行的容器的代码。
43-
如果有一个容器化的应用程序需要修改,则需要构建包含更改的新镜像,然后再基于新构建的镜像重新运行容器。
53+
容器旨在设计成无状态且[不可变的](https://glossary.cncf.io/immutable-infrastructure/)
54+
你不应更改已经运行的容器的代码。如果有一个容器化的应用程序需要修改,
55+
正确的流程是:先构建包含更改的新镜像,再基于新构建的镜像重新运行容器。
4456

4557
<!-- ## Container runtimes -->
4658
## 容器运行时 {#container-runtimes}
4759

4860
{{< glossary_definition term_id="container-runtime" length="all" >}}
4961

50-
## {{% heading "whatsnext" %}}
5162
<!--
52-
* Read about [container images](/docs/concepts/containers/images/)
53-
* Read about [Pods](/docs/concepts/workloads/pods/)
54-
-->
55-
56-
* 进一步阅读[容器镜像](/zh-cn/docs/concepts/containers/images/)
57-
* 进一步阅读 [Pods](/zh-cn/docs/concepts/workloads/pods/)
63+
Usually, you can allow your cluster to pick the default container runtime
64+
for a Pod. If you need to use more than one container runtime in your cluster,
65+
you can specify the [RuntimeClass](/docs/concepts/containers/runtime-class/)
66+
for a Pod to make sure that Kubernetes runs those containers using a
67+
particular container runtime.
5868
69+
You can also use RuntimeClass to run different Pods with the same container
70+
runtime but with different settings.
71+
-->
72+
通常,你可以允许集群为一个 Pod 选择其默认的容器运行时。如果你需要在集群中使用多个容器运行时,
73+
你可以为一个 Pod 指定 [RuntimeClass](/zh-cn/docs/concepts/containers/runtime-class/)
74+
以确保 Kubernetes 会使用特定的容器运行时来运行这些容器。
5975

76+
你还可以通过 RuntimeClass,使用相同的容器运行时,但使用不同设定的配置来运行不同的 Pod。

0 commit comments

Comments
 (0)