Skip to content

Commit 198179e

Browse files
authored
Merge pull request #27799 from mengjiao-liu/sync-secret
[zh] Sync content secret file
2 parents 5015aa2 + 7746f79 commit 198179e

File tree

1 file changed

+17
-30
lines changed
  • content/zh/docs/concepts/configuration

1 file changed

+17
-30
lines changed

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

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ Secret 是一种包含少量敏感信息例如密码、令牌或密钥的对象
5050
Kubernetes Secrets are, by default, stored as unencrypted base64-encoded
5151
strings. By default they can be retrieved - as plain text - by anyone with API
5252
access, or anyone with access to Kubernetes' underlying data store, etcd. In
53-
order to safely use Secrets, we recommend you (at a minimum):
53+
order to safely use Secrets, it is recommended you (at a minimum):
5454
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.
55+
1. [Enable Encryption at Rest](/zh/docs/tasks/administer-cluster/encrypt-data/) for Secrets.
56+
2. [Enable or configure RBAC rules](/docs/reference/access-authn-authz/authorization/) that restrict reading and writing the Secret. Be aware that secrets can be obtained implicitly by anyone with the permission to create a Pod.
5757
-->
5858
Kubernetes Secret 默认情况下存储为 base64-编码的、非加密的字符串。
5959
默认情况下,能够访问 API 的任何人,或者能够访问 Kubernetes 下层数据存储(etcd)
6060
的任何人都可以以明文形式读取这些数据。
6161
为了能够安全地使用 Secret,我们建议你(至少):
6262

6363
1. 为 Secret [启用静态加密](/zh/docs/tasks/administer-cluster/encrypt-data/)
64-
2. [启用 RBAC 规则来限制对 Secret 的读写操作](/zh/docs/reference/access-authn-authz/authorization/)
64+
2. [启用 或配置 RBAC 规则](/zh/docs/reference/access-authn-authz/authorization/)来限制对 Secret 的读写操作
6565
要注意,任何被允许创建 Pod 的人都默认地具有读取 Secret 的权限。
6666
{{< /caution >}}
6767

@@ -193,7 +193,7 @@ empty-secret Opaque 0 2m6s
193193

194194
<!--
195195
The `DATA` column shows the number of data items stored in the Secret.
196-
In this case, `0` means we have just created an empty Secret.
196+
In this case, `0` means we have created an empty Secret.
197197
-->
198198
`DATA` 列显示 Secret 中保存的数据条目个数。
199199
在这个例子种,`0` 意味着我们刚刚创建了一个空的 Secret。
@@ -204,7 +204,7 @@ In this case, `0` means we have just created an empty Secret.
204204
A `kubernetes.io/service-account-token` type of Secret is used to store a
205205
token that identifies a service account. When using this Secret type, you need
206206
to ensure that the `kubernetes.io/service-account.name` annotation is set to an
207-
existing service account name. An Kubernetes controller fills in some other
207+
existing service account name. A Kubernetes controller fills in some other
208208
fields such as the `kubernetes.io/service-account.uid` annotation and the
209209
`token` key in the `data` field set to actual token content.
210210
@@ -1068,8 +1068,8 @@ Kubelet is checking whether the mounted secret is fresh on every periodic sync.
10681068
However, it is using its local cache for getting the current value of the Secret.
10691069
10701070
The type of the cache is configurable using the (`ConfigMapAndSecretChangeDetectionStrategy` field in
1071-
[KubeletConfiguration struct](https://github.com/kubernetes/kubernetes/blob/{{< param "docsbranch" >}}/staging/src/k8s.io/kubelet/config/v1beta1/types.go)).
1072-
It can be either propagated via watch (default), ttl-based, or simply redirecting
1071+
the [KubeletConfiguration struct](/docs/reference/config-api/kubelet-config.v1beta1/).
1072+
A Secret can be either propagated by watch (default), ttl-based, or by redirecting
10731073
all requests to directly kube-apiserver.
10741074
As a result, the total delay from the moment when the Secret is updated to the moment
10751075
when new keys are projected to the Pod can be as long as kubelet sync period + cache
@@ -1082,7 +1082,7 @@ propagation delay, where cache propagation delay depends on the chosen cache typ
10821082
组件 kubelet 在周期性同步时检查被挂载的 Secret 是不是最新的。
10831083
但是,它会使用其本地缓存的数值作为 Secret 的当前值。
10841084

1085-
缓存的类型可以使用 [KubeletConfiguration 结构](https://github.com/kubernetes/kubernetes/blob/{{< param "docsbranch" >}}/staging/src/k8s.io/kubelet/config/v1beta1/types.go)
1085+
缓存的类型可以使用 [KubeletConfiguration 结构](/zh/docs/reference/config-api/kubelet-config.v1beta1/)
10861086
中的 `ConfigMapAndSecretChangeDetectionStrategy` 字段来配置。
10871087
它可以通过 watch 操作来传播(默认),基于 TTL 来刷新,也可以
10881088
将所有请求直接重定向到 API 服务器。
@@ -1151,7 +1151,7 @@ spec:
11511151
<!--
11521152
#### Consuming Secret Values from environment variables
11531153
1154-
Inside a container that consumes a secret in an environment variables, the secret keys appear as
1154+
Inside a container that consumes a secret in the environment variables, the secret keys appear as
11551155
normal environment variables containing the base64 decoded values of the secret data.
11561156
This is the result of commands executed inside the container from the example above:
11571157
-->
@@ -1203,10 +1203,10 @@ There are third party solutions for triggering restarts when secrets change.
12031203
-->
12041204
## 不可更改的 Secret {#secret-immutable}
12051205

1206-
{{< feature-state for_k8s_version="v1.19" state="beta" >}}
1206+
{{< feature-state for_k8s_version="v1.21" state="stable" >}}
12071207

12081208
<!--
1209-
The Kubernetes beta feature _Immutable Secrets and ConfigMaps_ provides an option to set
1209+
The Kubernetes feature _Immutable Secrets and ConfigMaps_ provides an option to set
12101210
individual Secrets and ConfigMaps as immutable. For clusters that extensively use Secrets
12111211
(at least tens of thousands of unique Secret to Pod mounts), preventing changes to their
12121212
data has the following advantages:
@@ -1215,7 +1215,7 @@ data has the following advantages:
12151215
- improves performance of your cluster by significantly reducing load on kube-apiserver, by
12161216
closing watches for secrets marked as immutable.
12171217
-->
1218-
Kubernetes 的 alpha 特性 _不可变的 Secret 和 ConfigMap_ 提供了一种可选配置,
1218+
Kubernetes 的特性 _不可变的 Secret 和 ConfigMap_ 提供了一种可选配置,
12191219
可以设置各个 Secret 和 ConfigMap 为不可变的。
12201220
对于大量使用 Secret 的集群(至少有成千上万各不相同的 Secret 供 Pod 挂载),
12211221
禁止变更它们的数据有下列好处:
@@ -1225,8 +1225,8 @@ Kubernetes 的 alpha 特性 _不可变的 Secret 和 ConfigMap_ 提供了一种
12251225
kube-apiserver 的负载,提升集群性能。
12261226

12271227
<!--
1228-
This feature is controlled by the `ImmutableEphemeralVolumes` [feature
1229-
gate](/docs/reference/command-line-tools-reference/feature-gates/),
1228+
This feature is controlled by the `ImmutableEphemeralVolumes`
1229+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/),
12301230
which is enabled by default since v1.19. You can create an immutable
12311231
Secret by setting the `immutable` field to `true`. For example,
12321232
-->
@@ -1300,17 +1300,6 @@ Pod 将会将其的 imagePullSecret 字段设置为服务帐户的 imagePullSecr
13001300
有关该过程的详细说明,请参阅
13011301
[将 ImagePullSecrets 添加到服务帐户](/zh/docs/tasks/configure-pod-container/configure-service-account/#adding-imagepullsecrets-to-a-service-account)。
13021302

1303-
<!--
1304-
### Automatic Mounting of Manually Created Secrets
1305-
1306-
Manually created secrets (e.g. one containing a token for accessing a github account)
1307-
can be automatically attached to pods based on their service account.
1308-
-->
1309-
1310-
#### 自动挂载手动创建的 Secret
1311-
1312-
手动创建的 Secret(例如包含用于访问 GitHub 帐户令牌的 Secret)可以
1313-
根据其服务帐户自动附加到 Pod。
13141303

13151304
<!--
13161305
## Details
@@ -1863,14 +1852,12 @@ Secret 中的值对于不同的环境来说重要性可能不同。
18631852
<!--
18641853
Applications that need to access the secrets API should perform `get` requests on
18651854
the secrets they need. This lets administrators restrict access to all secrets
1866-
while [white-listing access to individual instances](
1867-
/docs/reference/access-authn-authz/rbac/#referring-to-resources) that
1855+
while [white-listing access to individual instances](/docs/reference/access-authn-authz/rbac/#referring-to-resources) that
18681856
the app needs.
18691857

18701858
For improved performance over a looping `get`, clients can design resources that
18711859
reference a secret then `watch` the resource, re-requesting the secret when the
1872-
reference changes. Additionally, a ["bulk watch" API](
1873-
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/bulk_watch.md)
1860+
reference changes. Additionally, a ["bulk watch" API](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/bulk_watch.md)
18741861
to let clients `watch` individual resources has also been proposed, and will likely
18751862
be available in future releases of Kubernetes.
18761863
-->

0 commit comments

Comments
 (0)