[zh-cn] policy/example-psp.yaml

This commit is contained in:
windsonsea
2022-06-27 09:12:42 +08:00
parent 99dfe3670f
commit 4de73db709
2 changed files with 7 additions and 8 deletions
@@ -3,8 +3,8 @@ kind: PodSecurityPolicy
metadata: metadata:
name: example name: example
spec: spec:
privileged: false # Don't allow privileged pods! privileged: false # 不允许提权的 Pod
# The rest fills in some required fields. # 以下内容负责填充一些必需字段。
seLinux: seLinux:
rule: RunAsAny rule: RunAsAny
supplementalGroups: supplementalGroups:
@@ -4,13 +4,12 @@ metadata:
name: nginx-service name: nginx-service
spec: spec:
ports: ports:
- port: 8000 # the port that this service should serve on - port: 8000 # 在每个 Pod 的容器上要使用的端口;
# the container on each pod to connect to, can be a name # 服务将在此端口上运行,接受连接。
# (e.g. 'www') or a number (e.g. 80) # 端口可以是一个名称(例如:“www”)或一个数字(例如:80
targetPort: 80 targetPort: 80
protocol: TCP protocol: TCP
# just like the selector in the deployment, # 就像 Deployment 中的选择算符,
# but this time it identifies the set of pods to load balance # 但这里用于识别要对流量进行负载均衡的 Pod 集合。
# traffic to.
selector: selector:
app: nginx app: nginx