Skip to content

Commit 09fc6f9

Browse files
authored
sync en zh example yaml (#19778)
1 parent 9a33223 commit 09fc6f9

File tree

4 files changed

+99
-99
lines changed

4 files changed

+99
-99
lines changed
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
apiVersion: policy/v1beta1
2-
kind: PodSecurityPolicy
3-
metadata:
4-
name: restricted
5-
annotations:
6-
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
7-
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
8-
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
9-
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
10-
spec:
11-
privileged: false
12-
# Required to prevent escalations to root.
13-
allowPrivilegeEscalation: false
14-
# This is redundant with non-root + disallow privilege escalation,
15-
# but we can provide it for defense in depth.
16-
requiredDropCapabilities:
17-
- ALL
18-
# Allow core volume types.
19-
volumes:
20-
- 'configMap'
21-
- 'emptyDir'
22-
- 'projected'
23-
- 'secret'
24-
- 'downwardAPI'
25-
# Assume that persistentVolumes set up by the cluster admin are safe to use.
26-
- 'persistentVolumeClaim'
27-
hostNetwork: false
28-
hostIPC: false
29-
hostPID: false
30-
runAsUser:
31-
# Require the container to run without root privileges.
32-
rule: 'MustRunAsNonRoot'
33-
seLinux:
34-
# This policy assumes the nodes are using AppArmor rather than SELinux.
35-
rule: 'RunAsAny'
36-
supplementalGroups:
37-
rule: 'MustRunAs'
38-
ranges:
39-
# Forbid adding the root group.
40-
- min: 1
41-
max: 65535
42-
fsGroup:
43-
rule: 'MustRunAs'
44-
ranges:
45-
# Forbid adding the root group.
46-
- min: 1
47-
max: 65535
48-
readOnlyRootFilesystem: false
1+
apiVersion: policy/v1beta1
2+
kind: PodSecurityPolicy
3+
metadata:
4+
name: restricted
5+
annotations:
6+
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
7+
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
8+
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default'
9+
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
10+
spec:
11+
privileged: false
12+
# Required to prevent escalations to root.
13+
allowPrivilegeEscalation: false
14+
# This is redundant with non-root + disallow privilege escalation,
15+
# but we can provide it for defense in depth.
16+
requiredDropCapabilities:
17+
- ALL
18+
# Allow core volume types.
19+
volumes:
20+
- 'configMap'
21+
- 'emptyDir'
22+
- 'projected'
23+
- 'secret'
24+
- 'downwardAPI'
25+
# Assume that persistentVolumes set up by the cluster admin are safe to use.
26+
- 'persistentVolumeClaim'
27+
hostNetwork: false
28+
hostIPC: false
29+
hostPID: false
30+
runAsUser:
31+
# Require the container to run without root privileges.
32+
rule: 'MustRunAsNonRoot'
33+
seLinux:
34+
# This policy assumes the nodes are using AppArmor rather than SELinux.
35+
rule: 'RunAsAny'
36+
supplementalGroups:
37+
rule: 'MustRunAs'
38+
ranges:
39+
# Forbid adding the root group.
40+
- min: 1
41+
max: 65535
42+
fsGroup:
43+
rule: 'MustRunAs'
44+
ranges:
45+
# Forbid adding the root group.
46+
- min: 1
47+
max: 65535
48+
readOnlyRootFilesystem: false
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
apiVersion: v1
2-
kind: Pod
3-
metadata:
4-
name: my-empty-dir-pod
5-
spec:
6-
containers:
7-
- image: microsoft/windowsservercore:1709
8-
name: my-empty-dir-pod
9-
volumeMounts:
10-
- mountPath: /cache
11-
name: cache-volume
12-
- mountPath: C:/scratch
13-
name: scratch-volume
14-
volumes:
15-
- name: cache-volume
16-
emptyDir: {}
17-
- name: scratch-volume
18-
emptyDir: {}
19-
nodeSelector:
20-
beta.kubernetes.io/os: windows
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: my-empty-dir-pod
5+
spec:
6+
containers:
7+
- image: microsoft/windowsservercore:1709
8+
name: my-empty-dir-pod
9+
volumeMounts:
10+
- mountPath: /cache
11+
name: cache-volume
12+
- mountPath: C:/scratch
13+
name: scratch-volume
14+
volumes:
15+
- name: cache-volume
16+
emptyDir: {}
17+
- name: scratch-volume
18+
emptyDir: {}
19+
nodeSelector:
20+
beta.kubernetes.io/os: windows
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
apiVersion: v1
2-
kind: Pod
3-
metadata:
4-
name: run-as-username-container-demo
5-
spec:
6-
securityContext:
7-
windowsOptions:
8-
runAsUserName: "ContainerUser"
9-
containers:
10-
- name: run-as-username-demo
11-
image: mcr.microsoft.com/windows/servercore:ltsc2019
12-
command: ["ping", "-t", "localhost"]
13-
securityContext:
14-
windowsOptions:
15-
runAsUserName: "ContainerAdministrator"
16-
nodeSelector:
17-
beta.kubernetes.io/os: windows
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: run-as-username-container-demo
5+
spec:
6+
securityContext:
7+
windowsOptions:
8+
runAsUserName: "ContainerUser"
9+
containers:
10+
- name: run-as-username-demo
11+
image: mcr.microsoft.com/windows/servercore:ltsc2019
12+
command: ["ping", "-t", "localhost"]
13+
securityContext:
14+
windowsOptions:
15+
runAsUserName: "ContainerAdministrator"
16+
nodeSelector:
17+
kubernetes.io/os: windows
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
apiVersion: v1
2-
kind: Pod
3-
metadata:
4-
name: run-as-username-pod-demo
5-
spec:
6-
securityContext:
7-
windowsOptions:
8-
runAsUserName: "ContainerUser"
9-
containers:
10-
- name: run-as-username-demo
11-
image: mcr.microsoft.com/windows/servercore:ltsc2019
12-
command: ["ping", "-t", "localhost"]
13-
nodeSelector:
14-
beta.kubernetes.io/os: windows
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: run-as-username-pod-demo
5+
spec:
6+
securityContext:
7+
windowsOptions:
8+
runAsUserName: "ContainerUser"
9+
containers:
10+
- name: run-as-username-demo
11+
image: mcr.microsoft.com/windows/servercore:ltsc2019
12+
command: ["ping", "-t", "localhost"]
13+
nodeSelector:
14+
kubernetes.io/os: windows

0 commit comments

Comments
 (0)