Skip to content

Commit 43773ac

Browse files
committed
update zh-trans of pod-security-policy.md
1 parent 7881e33 commit 43773ac

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

content/zh/docs/concepts/policy/pod-security-policy.md

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ weight: 20
1414
Pod Security Policies enable fine-grained authorization of pod creation and
1515
updates.
1616
-->
17-
PodSecurityPolicy支持针对 pod 创建和更新进行精细的权限控制。
17+
Pod 安全策略支持针对 pod 创建和更新进行精细的权限控制。
1818

1919
{{% /capture %}}
2020

@@ -24,7 +24,7 @@ PodSecurityPolicy支持针对 pod 创建和更新进行精细的权限控制。
2424
<!--
2525
## What is a Pod Security Policy?
2626
-->
27-
## 什么是 PodSecurityPolicy
27+
## 什么是 Pod 安全策略
2828

2929
<!--
3030
A _Pod Security Policy_ is a cluster-level resource that controls security
@@ -33,55 +33,55 @@ define a set of conditions that a pod must run with in order to be accepted into
3333
the system, as well as defaults for the related fields. They allow an
3434
administrator to control the following:
3535
-->
36-
_PodSecurityPolicy_ 是集群级别的资源,它能够控制 Pod 规范中对安全敏感的方面。
36+
_Pod 安全策略_ 是集群级别的资源,它能够控制 Pod 规范中对安全敏感的方面。
3737
[PodSecurityPolicy](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy)
38-
对象定义了一组条件,指示 Pod 必须按系统所能接受的顺序运行,以及相关字段的默认值
38+
对象定义了一组 pod 必须在其上运行才能被系统接受的条件,以及相关字段的默认设置
3939
它们允许管理员控制如下方面:
4040

4141
<!--
42-
| Control Aspect | Field Names |
43-
| ----------------------------------------------------| ------------------------------------------- |
44-
| Running of privileged containers | [`privileged`](#privileged) |
45-
| Usage of host namespaces | [`hostPID`, `hostIPC`](#host-namespaces) |
46-
| Usage of host networking and ports | [`hostNetwork`, `hostPorts`](#host-namespaces) |
47-
| Usage of volume types | [`volumes`](#volumes-and-file-systems) |
48-
| Usage of the host filesystem | [`allowedHostPaths`](#volumes-and-file-systems) |
49-
| White list of FlexVolume drivers | [`allowedFlexVolumes`](#flexvolume-drivers) |
50-
| Allocating an FSGroup that owns the pod's volumes | [`fsGroup`](#volumes-and-file-systems) |
51-
| Requiring the use of a read only root file system | [`readOnlyRootFilesystem`](#volumes-and-file-systems) |
52-
| The user and group IDs of the container | [`runAsUser`, `runAsGroup`, `supplementalGroups`](#users-and-groups) |
53-
| Restricting escalation to root privileges | [`allowPrivilegeEscalation`, `defaultAllowPrivilegeEscalation`](#privilege-escalation) |
54-
| Linux capabilities | [`defaultAddCapabilities`, `requiredDropCapabilities`, `allowedCapabilities`](#capabilities) |
55-
| The SELinux context of the container | [`seLinux`](#selinux) |
56-
| The Allowed Proc Mount types for the container | [`allowedProcMountTypes`](#allowedprocmounttypes) |
57-
| The AppArmor profile used by containers | [annotations](#apparmor) |
58-
| The seccomp profile used by containers | [annotations](#seccomp) |
59-
| The sysctl profile used by containers | [`forbiddenSysctls`,`allowedUnsafeSysctls`](#sysctl) |
42+
| Control Aspect | Field Names |
43+
|---------------------------------------------------|----------------------------------------------------------------------------------------------|
44+
| Running of privileged containers | [`privileged`](#privileged) |
45+
| Usage of host namespaces | [`hostPID`, `hostIPC`](#host-namespaces) |
46+
| Usage of host networking and ports | [`hostNetwork`, `hostPorts`](#host-namespaces) |
47+
| Usage of volume types | [`volumes`](#volumes-and-file-systems) |
48+
| Usage of the host filesystem | [`allowedHostPaths`](#volumes-and-file-systems) |
49+
| White list of FlexVolume drivers | [`allowedFlexVolumes`](#flexvolume-drivers) |
50+
| Allocating an FSGroup that owns the pod's volumes | [`fsGroup`](#volumes-and-file-systems) |
51+
| Requiring the use of a read only root file system | [`readOnlyRootFilesystem`](#volumes-and-file-systems) |
52+
| The user and group IDs of the container | [`runAsUser`, `runAsGroup`, `supplementalGroups`](#users-and-groups) |
53+
| Restricting escalation to root privileges | [`allowPrivilegeEscalation`, `defaultAllowPrivilegeEscalation`](#privilege-escalation) |
54+
| Linux capabilities | [`defaultAddCapabilities`, `requiredDropCapabilities`, `allowedCapabilities`](#capabilities) |
55+
| The SELinux context of the container | [`seLinux`](#selinux) |
56+
| The Allowed Proc Mount types for the container | [`allowedProcMountTypes`](#allowedprocmounttypes) |
57+
| The AppArmor profile used by containers | [annotations](#apparmor) |
58+
| The seccomp profile used by containers | [annotations](#seccomp) |
59+
| The sysctl profile used by containers | [`forbiddenSysctls`,`allowedUnsafeSysctls`](#sysctl) |
6060
6161
-->
62-
| 控制面 | 字段名称 |
63-
|--------------------------------|----------------------------------------------------------------------------------------------|
64-
| 已授权容器的运行 | [`privileged`](#privileged) |
65-
| 主机 PID namespace 的使用 | [`hostPID`, `hostIPC`](#host-namespaces) |
62+
| 所控制的方面 | 字段名称 |
63+
|----------------------------------|----------------------------------------------------------------------------------------------|
64+
| 运行特权容器 | [`privileged`](#privileged) |
65+
| 使用主机 PID 的命名空间 | [`hostPID`, `hostIPC`](#host-namespaces) |
6666
| 主机网络的使用 | [`hostNetwork`,`hostPorts`](#host-namespaces) |
6767
| 控制卷类型的使用 | [`volumes`](#volumes-and-file-systems) |
6868
| 主机路径的使用 | [`allowedHostPaths`](#volumes-and-file-systems) |
6969
| FlexVolume 卷驱动的白名单 | [`allowedFlexVolumes`](#flexvolume-drivers) |
7070
| 分配拥有 Pod 数据卷的 FSGroup | [`fsGroup`](#volumes-and-file-systems) |
71-
| 必须使用一个只读的 root 文件系统 | [`readOnlyRootFilesystem`(#volumes-and-file-systems) |
71+
| 必须使用一个只读的 root 文件系统 | [`readOnlyRootFilesystem`(#volumes-and-file-systems) |
7272
| 容器的用户和组的 ID | [`runAsUser`, `runAsGroup`, `supplementalGroups`](#users-and-groups) |
73-
| 提升为 root 权限的限制 | [`allowPrivilegeEscalation`, `defaultAllowPrivilegeEscalation`](#privilege-escalation) |
74-
| 为容器添加默认的一组能力 | [`defaultAddCapabilities`, `requiredDropCapabilities`, `allowedCapabilities`](#capabilities) |
73+
| 限制提升为 root 特权 | [`allowPrivilegeEscalation`, `defaultAllowPrivilegeEscalation`](#privilege-escalation) |
74+
| 为容器添加默认的一组能力 | [`defaultAddCapabilities`, `requiredDropCapabilities`, `allowedCapabilities`](#capabilities) |
7575
| 容器的 SELinux 上下文 | [`seLinux`](#selinux) |
76-
| 容器允许的 Proc 挂载类型 | [`allowedProcMountTypes`](#allowedprocmounttypes) |
77-
| 容器使用的 AppArmor 配置文件 | [annotations](#apparmor) |
78-
| 容器使用的 seccomp 配置文件 | [annotations](#seccomp) |
79-
| 容器使用的 sysctl 配置文件 | [`forbiddenSysctls`,`allowedUnsafeSysctls`](#sysctl) |
76+
| 容器允许的 Proc 挂载类型 | [`allowedProcMountTypes`](#allowedprocmounttypes) |
77+
| 容器使用的 AppArmor 配置 | [annotations](#apparmor) |
78+
| 容器使用的 seccomp 配置 | [annotations](#seccomp) |
79+
| 容器使用的 sysctl 配置 | [`forbiddenSysctls`,`allowedUnsafeSysctls`](#sysctl) |
8080

8181
<!--
8282
## Enabling Pod Security Policies
8383
-->
84-
## 启用 PodSecurityPolicy
84+
## 启用 Pod 安全策略
8585

8686
<!--
8787
Pod security policy control is implemented as an optional (but recommended)
@@ -93,7 +93,7 @@ but doing so without authorizing any policies **will prevent any pods from being
9393
created** in the cluster.
9494
-->
9595

96-
PodSecurityPolicy 控制是 [admission 控制器](/docs/reference/access-authn-authz/admission-controllers/#podsecuritypolicy)
96+
Pod 安全策略控制是 [admission 控制器](/docs/reference/access-authn-authz/admission-controllers/#podsecuritypolicy)
9797
的一个可选实现。PodSecurityPolicy通过 [启用 admission 控制器](/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-control-plug-in) 被强制启用,
9898
但是如果集群内没有授权任何策略时这样做 **将导致任何 pod 都无法被创建**
9999

@@ -103,7 +103,7 @@ enabled independently of the admission controller, for existing clusters it is
103103
recommended that policies are added and authorized before enabling the admission
104104
controller.
105105
-->
106-
由于 PodSecurityPolicy API (`policy/v1beta1/podsecuritypolicy`) 时独立于 admission 控制器启用的,
106+
由于 Pod 安全策略 API (`policy/v1beta1/podsecuritypolicy`) 时独立于 admission 控制器启用的,
107107
所以对于现有集群推荐在启用 admission 控制器之前就添加并授权安全策略。
108108

109109
<!--
@@ -132,7 +132,7 @@ pod's service account (see [example](#run-another-pod)).
132132
-->
133133
多数 Kubernetes pod 并非由用户直接创建。相反,通常他们作为 [Deployment](/docs/concepts/workloads/controllers/deployment/)
134134
[ReplicaSet](/docs/concepts/workloads/controllers/replicaset/) 或者其他的模板控制器的组成部分由控制器管理器被间接地创建。
135-
授权策略给控制器即授权给 **所有** 由该控制器创建的 pod,因此授权策略的授权方式应该时授权给 pod 的服务账户 (参见 [示例](#run-another-pod))。
135+
授权策略给控制器即授权给 **所有** 由该控制器创建的 pod,因此授权策略的授权方式应该时授权给 pod 的 service account (参见 [示例](#run-another-pod))。
136136

137137
<!--
138138
### Via RBAC
@@ -246,7 +246,7 @@ paired with system groups to grant access to all pods run in the namespace:
246246
```
247247
-->
248248
```yaml
249-
# 授权命名空间下的所有服务账户:
249+
# 授权命名空间下的所有 service accounts:
250250
- kind: Group
251251
apiGroup: rbac.authorization.k8s.io
252252
name: system:serviceaccounts
@@ -294,7 +294,7 @@ also be used to provide default values for many of the fields that it
294294
controls. When multiple policies are available, the pod security policy
295295
controller selects policies according to the following criteria:
296296
-->
297-
除了限制 pod 的创建和更新之外,PodSecurityPolicy 也可以用于为由其控制的许多字段提供默认值。当同时多个策略可用时,PodSecurityPolicy 控制器依据以下标准选择策略
297+
除了限制 pod 的创建和更新之外,pod 安全策略也可以用于为由其控制的许多字段提供默认值。当同时多个策略可用时,pod 安全策略控制器依据以下标准选择策略
298298

299299
<!--
300300
1. PodSecurityPolicies which allow the pod as-is, without changing defaults or
@@ -334,7 +334,7 @@ _这个示例假定你有一个运行中且已启用 PodSecurityPolicy admission
334334
Set up a namespace and a service account to act as for this example. We'll use
335335
this service account to mock a non-admin user.
336336
-->
337-
以此为例设置一个命名空间和服务账户. 我们将使用这个服务账户来模拟一个非管理员用户.
337+
以此为例设置一个命名空间和 service account. 我们将使用这个 service account 来模拟一个非管理员用户.
338338

339339
```shell
340340
kubectl create namespace psp-example
@@ -401,7 +401,7 @@ Error from server (Forbidden): error when creating "STDIN": pods "pause" is forb
401401
**What happened?** Although the PodSecurityPolicy was created, neither the
402402
pod's service account nor `fake-user` have permission to use the new policy:
403403
-->
404-
***发生了什么?* 尽管 PodSecurityPolicy 已经创建, pod 的 service account 和 `fake-user` 都没有权限使用这个策略:
404+
**发生了什么?** 尽管 PodSecurityPolicy 已经创建, pod 的 service account 和 `fake-user` 都没有权限使用这个策略:
405405

406406
```shell
407407
kubectl-user auth can-i use podsecuritypolicy/example
@@ -441,7 +441,7 @@ yes
441441
<!--
442442
Now retry creating the pod:
443443
-->
444-
接下来尝试创建这个 pod:
444+
现在重新创建这个 pod:
445445

446446
```shell
447447
kubectl-user create -f- <<EOF
@@ -461,7 +461,7 @@ pod "pause" created
461461
It works as expected! But any attempts to create a privileged pod should still
462462
be denied:
463463
-->
464-
它按预期运行,但是任何创建特权 pod 的尝试应当都被拒绝:
464+
它如期运行,但是任何创建特权 pod 的尝试都应当被拒绝:
465465

466466
```shell
467467
kubectl-user create -f- <<EOF
@@ -519,7 +519,7 @@ deployment (which successfully created a replicaset), but when the replicaset
519519
went to create the pod it was not authorized to use the example
520520
podsecuritypolicy.
521521
-->
522-
**发生了什么?**我们已经将 `psp:unprivileged` 角色绑定给了 `fake-user`, 为何仍然报错
522+
**发生了什么?** 我们已经将 `psp:unprivileged` 角色绑定给了 `fake-user`, 为何仍然报错
523523
`Error creating: pods "pause-7774d79b5-" is forbidden: no providers available to validate pod request`?
524524
答案在 `replicaset-controller` 源码中. Fake-user 成功创建了 deployment (并且该 deployment 成功创建了一个 replicaset),
525525
然而当该 replicaset 想要创建 pod 时却没有权限使用我们的示例 pod 安全策略.
@@ -529,7 +529,7 @@ In order to fix this, bind the `psp:unprivileged` role to the pod's service
529529
account instead. In this case (since we didn't specify it) the service account
530530
is `default`:
531531
-->
532-
为了修复这个问题,将 `psp:unprivileged` 角色绑定给 pod 的 service account. 在这种情况下(由于我们没有显式指定) 该 service account 为 `default`:
532+
为了修复这个问题将 `psp:unprivileged` 角色绑定给 pod 的 service account. 在这种情况下(由于我们没有显式指定) 该 service account 为 `default`:
533533

534534
```shell
535535
kubectl-admin create rolebinding default:psp:unprivileged \
@@ -780,7 +780,7 @@ kind: PodSecurityPolicy
780780
metadata:
781781
name: allow-flex-volumes
782782
spec:
783-
# ... other spec fields
783+
# ... 其他特性字段
784784
volumes:
785785
- flexVolume
786786
allowedFlexVolumes:

0 commit comments

Comments
 (0)