Skip to content

Commit 629528b

Browse files
authored
Merge pull request #44070 from qlijin/service-accounts.md
[zh-cn] sync service-accounts.md
2 parents 16bb7a1 + e1d4765 commit 629528b

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

content/zh-cn/docs/concepts/security/service-accounts.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,65 @@ You can also use TokenRequest to obtain short-lived tokens for your external app
374374
你还可以使用 TokenRequest 为外部应用获取短期的令牌。
375375
{{< /note >}}
376376

377+
<!--
378+
### Restricting access to Secrets {#enforce-mountable-secrets}
379+
-->
380+
### 限制对 Secret 的访问 {#enforce-mountable-secrets}
381+
382+
<!--
383+
Kubernetes provides an annotation called `kubernetes.io/enforce-mountable-secrets`
384+
that you can add to your ServiceAccounts. When this annotation is applied,
385+
the ServiceAccount's secrets can only be mounted on specified types of resources,
386+
enhancing the security posture of your cluster.
387+
388+
You can add the annotation to a ServiceAccount using a manifest:
389+
-->
390+
Kubernetes 提供了名为 `kubernetes.io/enforce-mountable-secrets` 的注解,
391+
你可以添加到你的 ServiceAccount 中。当应用了这个注解后,
392+
ServiceAccount 的 Secret 只能挂载到特定类型的资源上,从而增强集群的安全性。
393+
394+
你可以使用以下清单将注解添加到一个 ServiceAccount 中:
395+
396+
```yaml
397+
apiVersion: v1
398+
kind: ServiceAccount
399+
metadata:
400+
annotations:
401+
kubernetes.io/enforce-mountable-secrets: "true"
402+
name: my-serviceaccount
403+
namespace: my-namespace
404+
```
405+
406+
<!--
407+
When this annotation is set to "true", the Kubernetes control plane ensures that
408+
the Secrets from this ServiceAccount are subject to certain mounting restrictions.
409+
-->
410+
当此注解设置为 "true" 时,Kubernetes 控制平面确保来自该 ServiceAccount 的 Secret 受到特定挂载限制。
411+
412+
<!--
413+
1. The name of each Secret that is mounted as a volume in a Pod must appear in the `secrets` field of the
414+
Pod's ServiceAccount.
415+
-->
416+
1. 在 Pod 中作为卷挂载的每个 Secret 的名称必须列在该 Pod 中 ServiceAccount 的 `secrets` 字段中。
417+
418+
<!--
419+
1. The name of each Secret referenced using `envFrom` in a Pod must also appear in the `secrets`
420+
field of the Pod's ServiceAccount.
421+
-->
422+
2. 在 Pod 中使用 `envFrom` 引用的每个 Secret 的名称也必须列在该 Pod 中 ServiceAccount 的 `secrets` 字段中。
423+
424+
<!--
425+
1. The name of each Secret referenced using `imagePullSecrets` in a Pod must also appear in the `secrets`
426+
field of the Pod's ServiceAccount.
427+
-->
428+
3. 在 Pod 中使用 `imagePullSecrets` 引用的每个 Secret 的名称也必须列在该 Pod 中
429+
ServiceAccount 的 `secrets` 字段中。
430+
431+
<!--
432+
By understanding and enforcing these restrictions, cluster administrators can maintain a tighter security profile and ensure that secrets are accessed only by the appropriate resources.
433+
-->
434+
通过理解并执行这些限制,集群管理员可以维护更严格的安全配置,并确保 Secret 仅被适当的资源访问。
435+
377436
<!--
378437
## Authenticating service account credentials {#authenticating-credentials}
379438
-->

0 commit comments

Comments
 (0)