Skip to content

Commit b9265d3

Browse files
committed
[zh] Clean PodPreset related pages/examples
1 parent 2f344c8 commit b9265d3

File tree

18 files changed

+85
-893
lines changed

18 files changed

+85
-893
lines changed

content/zh/docs/concepts/configuration/secret.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ Secret 是一种包含少量敏感信息例如密码、令牌或密钥的对象
4545
这样的信息可能会被放在 Pod 规约中或者镜像中。
4646
用户可以创建 Secret,同时系统也创建了一些 Secret。
4747

48+
{{< caution >}}
49+
<!--
50+
Kubernetes Secrets are, by default, stored as unencrypted base64-encoded
51+
strings. By default they can be retrieved - as plain text - by anyone with API
52+
access, or anyone with access to Kubernetes' underlying data store, etcd. In
53+
order to safely use Secrets, we recommend you (at a minimum):
54+
55+
1. [Enable Encryption at Rest](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/) for Secrets.
56+
2. [Enable RBAC rules that restrict reading and writing the Secret](https://kubernetes.io/docs/reference/access-authn-authz/authorization/). Be aware that secrets can be obtained implicitly by anyone with the permission to create a Pod.
57+
-->
58+
Kubernetes Secret 默认情况下存储为 base64-编码的、非加密的字符串。
59+
默认情况下,能够访问 API 的任何人,或者能够访问 Kubernetes 下层数据存储(etcd)
60+
的任何人都可以以明文形式读取这些数据。
61+
为了能够安全地使用 Secret,我们建议你(至少):
62+
63+
1. 为 Secret [启用静态加密](/zh/docs/tasks/administer-cluster/encrypt-data/)
64+
2. [启用 RBAC 规则来限制对 Secret 的读写操作](/zh/docs/reference/access-authn-authz/authorization/)
65+
要注意,任何被允许创建 Pod 的人都默认地具有读取 Secret 的权限。
66+
{{< /caution >}}
67+
4868
<!-- body -->
4969

5070
<!--
@@ -1243,7 +1263,7 @@ these pods.
12431263
The `imagePullSecrets` field is a list of references to secrets in the same namespace.
12441264
You can use an `imagePullSecrets` to pass a secret that contains a Docker (or other) image registry
12451265
password to the kubelet. The kubelet uses this information to pull a private image on behalf of your Pod.
1246-
See the [PodSpec API](/docs/reference/generated/kubernetes-api/{{< latest-version >}}/#podspec-v1-core) for more information about the `imagePullSecrets` field.
1266+
See the [PodSpec API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core) for more information about the `imagePullSecrets` field.
12471267

12481268
#### Manually specifying an imagePullSecret
12491269

@@ -1254,7 +1274,8 @@ You can learn how to specify `ImagePullSecrets` from the [container images docum
12541274
`imagePullSecrets` 字段中包含一个列表,列举对同一名字空间中的 Secret 的引用。
12551275
你可以使用 `imagePullSecrets` 将包含 Docker(或其他)镜像仓库密码的 Secret 传递给
12561276
kubelet。kubelet 使用此信息来替你的 Pod 拉取私有镜像。
1257-
关于 `imagePullSecrets` 字段的更多信息,请参考 [PodSpec API](/docs/reference/generated/kubernetes-api/{{< latest-version >}}/#podspec-v1-core) 文档。
1277+
关于 `imagePullSecrets` 字段的更多信息,请参考
1278+
[PodSpec API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core) 文档。
12581279

12591280
#### 手动指定 imagePullSecret
12601281

@@ -1284,15 +1305,12 @@ Pod 将会将其的 imagePullSecret 字段设置为服务帐户的 imagePullSecr
12841305

12851306
Manually created secrets (e.g. one containing a token for accessing a github account)
12861307
can be automatically attached to pods based on their service account.
1287-
See [Injecting Information into Pods Using a PodPreset](/docs/tasks/inject-data-application/podpreset/) for a detailed explanation of that process.
12881308
-->
12891309

12901310
#### 自动挂载手动创建的 Secret
12911311

12921312
手动创建的 Secret(例如包含用于访问 GitHub 帐户令牌的 Secret)可以
12931313
根据其服务帐户自动附加到 Pod。
1294-
请参阅[使用 PodPreset 向 Pod 中注入信息](/zh/docs/tasks/inject-data-application/podpreset/)
1295-
以获取该过程的详细说明。
12961314

12971315
<!--
12981316
## Details

content/zh/docs/concepts/workloads/pods/_index.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Pods"
2+
title: Pods
33
content_type: concept
44
weight: 10
55
no_list: true
@@ -26,7 +26,7 @@ _Pods_ are the smallest deployable units of computing that you can create and ma
2626
2727
A _Pod_ (as in a pod of whales or pea pod) is a group of one or more
2828
{{< glossary_tooltip text="containers" term_id="container" >}}
29-
with shared storage/network resources, and a specification
29+
with shared storage and network resources, and a specification
3030
for how to run the containers. A Pod's contents are always co-located and
3131
co-scheduled, and run in a shared context. A Pod models an
3232
application-specific "logical host": it contains one or more application
@@ -350,6 +350,62 @@ changing existing code.
350350
这种抽象和关注点分离简化了整个系统的语义,并且使得用户可以在不改变现有代码的
351351
前提下就能扩展集群的行为。
352352

353+
<!--
354+
## Pod update and replacement
355+
356+
As mentioned in the previous section, when the Pod template for a workload
357+
resource is changed, the controller creates new Pods based on the updated
358+
template instead of updating or patching the existing Pods.
359+
-->
360+
## Pod 更新与替换 {#pod-update-and-replacement}
361+
362+
正如前面章节所述,当某工作负载的 Pod 模板被改变时,控制器会基于更新的模板
363+
创建新的 Pod 对象而不是对现有 Pod 执行更新或者修补操作。
364+
365+
<!--
366+
Kubernetes doesn't prevent you from managing Pods directly. It is possible to
367+
update some fields of a running Pod, in place. However, Pod update operations
368+
like
369+
[`patch`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#patch-pod-v1-core), and
370+
[`replace`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#replace-pod-v1-core)
371+
have some limitations:
372+
-->
373+
Kubernetes 并不禁止你直接管理 Pod。对运行中的 Pod 的某些字段执行就地更新操作
374+
还是可能的。不过,类似
375+
[`patch`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#patch-pod-v1-core) 和
376+
[`replace`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#replace-pod-v1-core)
377+
这类更新操作有一些限制:
378+
379+
<!--
380+
- Most of the metadata about a Pod is immutable. For example, you cannot
381+
change the `namespace`, `name`, `uid`, or `creationTimestamp` fields;
382+
the `generation` field is unique. It only accepts updates that increment the
383+
field's current value.
384+
- If the `metadata.deletionTimestamp` is set, no new entry can be added to the
385+
`metadata.finalizers` list.
386+
- Pod updates may not change fields other than `spec.containers[*].image`,
387+
`spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or
388+
`spec.tolerations`. For `spec.tolerations`, you can only add new entries.
389+
- When updating the `spec.activeDeadlineSeconds` field, two types of updates
390+
are allowed:
391+
392+
1. setting the unassigned field to a positive number;
393+
1. updating the field from a positive number to a smaller, non-negative
394+
number.
395+
-->
396+
- Pod 的绝大多数元数据都是不可变的。例如,你不可以改变其 `namespace``name`
397+
`uid` 或者 `creationTimestamp` 字段;`generation` 字段是比较特别的,如果更新
398+
该字段,只能增加字段取值而不能减少。
399+
- 如果 `metadata.deletionTimestamp` 已经被设置,则不可以向 `metadata.finalizers`
400+
列表中添加新的条目。
401+
- Pod 更新不可以改变除 `spec.containers[*].image``spec.initContainers[*].image`
402+
`spec.activeDeadlineSeconds``spec.tolerations` 之外的字段。
403+
对于 `spec.tolerations`,你只被允许添加新的条目到其中。
404+
- 在更新`spec.activeDeadlineSeconds` 字段时,以下两种更新操作是被允许的:
405+
406+
1. 如果该字段尚未设置,可以将其设置为一个正数;
407+
1. 如果该字段已经设置为一个正数,可以将其设置为一个更小的、非负的整数。
408+
353409
<!--
354410
## Resource sharing and communication
355411
@@ -486,7 +542,6 @@ but cannot be controlled from there.
486542

487543
<!--
488544
* Learn about the [lifecycle of a Pod](/docs/concepts/workloads/pods/pod-lifecycle/).
489-
* Learn about [PodPresets](/docs/concepts/workloads/pods/podpreset/).
490545
* Learn about [RuntimeClass](/docs/concepts/containers/runtime-class/) and how you can use it to
491546
configure different Pods with different container runtime configurations.
492547
* Read about [Pod topology spread constraints](/docs/concepts/workloads/pods/pod-topology-spread-constraints/).
@@ -497,7 +552,6 @@ but cannot be controlled from there.
497552
* [The Distributed System Toolkit: Patterns for Composite Containers](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns) explains common layouts for Pods with more than one container.
498553
--
499554
* 了解 [Pod 生命周期](/zh/docs/concepts/workloads/pods/pod-lifecycle/)
500-
* 了解 [PodPresets](/zh/docs/concepts/workloads/pods/podpreset/)
501555
* 了解 [RuntimeClass](/zh/docs/concepts/containers/runtime-class/),以及如何使用它
502556
来配置不同的 Pod 使用不同的容器运行时配置
503557
* 了解 [Pod 拓扑分布约束](/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints/)
@@ -510,7 +564,7 @@ but cannot be controlled from there.
510564
中解释了在同一 Pod 中包含多个容器时的几种常见布局。
511565
512566
<!--
513-
To understand the context for why Kubernetes wraps a common Pod API in other resources (such as {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} or {{< glossary_tooltip text="Deployments" term_id="deployment" >}}, you can read about the prior art, including:
567+
To understand the context for why Kubernetes wraps a common Pod API in other resources (such as {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} or {{< glossary_tooltip text="Deployments" term_id="deployment" >}}), you can read about the prior art, including:
514568
-->
515569
要了解为什么 Kubernetes 会在其他资源
516570
(如 {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}}

content/zh/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,19 +1117,6 @@ For more information about persistent volume claims, see [PersistentVolumeClaims
11171117
关于持久化卷申领的更多信息,请参见
11181118
[PersistentVolumeClaims](/zh/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)。
11191119

1120-
### PodPreset {#podpreset}
1121-
1122-
<!--
1123-
This admission controller injects a pod with the fields specified in a matching PodPreset.
1124-
See also [PodPreset concept](/docs/concepts/workloads/pods/podpreset/) and
1125-
[Inject Information into Pods Using a PodPreset](/docs/tasks/inject-data-application/podpreset)
1126-
for more information.
1127-
-->
1128-
该准入控制器根据与 PodPreset 中条件的匹配情况,将指定字段注入一个 Pod。
1129-
另请参见 [PodPreset 概念](/zh/docs/concepts/workloads/pods/podpreset/)和
1130-
[使用 PodPreset 将信息注入 Pod](/zh/docs/tasks/inject-data-application/podpreset)
1131-
了解更多信息。
1132-
11331120
### PodSecurityPolicy {#podsecuritypolicy}
11341121

11351122
<!--
@@ -1350,12 +1337,12 @@ versions 1.9 and later).
13501337
<!--
13511338
## Is there a recommended set of admission controllers to use?
13521339

1353-
Yes. For Kubernetes version 1.10 and later, the recommended admission controllers are enabled by default (shown [here](/docs/reference/command-line-tools-reference/kube-apiserver/#options)), so you do not need to explicitly specify them. You can enable additional admission controllers beyond the default set using the `--enable-admission-plugins` flag (**order doesn't matter**).
1340+
Yes. The recommended admission controllers are enabled by default (shown [here](/docs/reference/command-line-tools-reference/kube-apiserver/#options)), so you do not need to explicitly specify them. You can enable additional admission controllers beyond the default set using the `--enable-admission-plugins` flag (**order doesn't matter**).
13541341
-->
13551342
## 有推荐的准入控制器吗?
13561343

1357-
有。对于 Kubernetes 1.10 以上的版本,推荐使用的准入控制器默认情况下都处于启用状态
1358-
查看[这里](/zh/docs/reference/command-line-tools-reference/kube-apiserver/#options))。
1344+
有。推荐使用的准入控制器默认情况下都处于启用状态
1345+
请查看[这里](/zh/docs/reference/command-line-tools-reference/kube-apiserver/#options))。
13591346
因此,你无需显式指定它们。
13601347
你可以使用 `--enable-admission-plugins` 标志( **顺序不重要** )来启用默认设置以外的其他准入控制器。
13611348

@@ -1366,31 +1353,3 @@ Yes. For Kubernetes version 1.10 and later, the recommended admission controller
13661353
`--admission-control` 在 1.10 中已废弃,由 `--enable-admission-plugins` 取代。
13671354
{{< /note >}}
13681355

1369-
<!--
1370-
For Kubernetes 1.9 and earlier, we recommend running the following set of admission controllers using the `--admission-control` flag (**order matters**).
1371-
-->
1372-
对于 Kubernetes 1.9 及更早版本,我们建议使用 `--admission-control` 标志
1373-
(**顺序很重要**)运行下面的一组准入控制器。
1374-
1375-
* v1.9
1376-
1377-
```shell
1378-
--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota
1379-
```
1380-
1381-
<!--
1382-
* It's worth reiterating that in 1.9, these happen in a mutating phase
1383-
and a validating phase, and that for example `ResourceQuota` runs in the validating
1384-
phase, and therefore is the last admission controller to run.
1385-
`MutatingAdmissionWebhook` appears before it in this list, because it runs
1386-
in the mutating phase.
1387-
-->
1388-
* 需要重申的是,在 1.9 中,它们都发生在变更阶段和验证阶段,例如 `ResourceQuota`
1389-
在验证阶段运行,因此是最后一个运行的准入控制器。
1390-
`MutatingAdmissionWebhook` 出现在此列表的前面,因为它在变更阶段运行。
1391-
1392-
<!--
1393-
For earlier versions, there was no concept of validating versus mutating and the
1394-
admission controllers ran in the exact order specified.
1395-
-->
1396-
对于更早期版本,没有验证和变更的概念,并且准入控制器按照指定的确切顺序运行。

content/zh/docs/reference/glossary/podpreset.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)