You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/en/docs/best-practices/pod-security-standards.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,23 @@ on the namespace level will **not** be admitted. In this way, it will not be pos
20
20
21
21
#### How should I configure my Operators and Operands to comply with the criteria?
22
22
23
-
-**For common cases that do not require escalating privileges:** configure all containers to comply with the [restrictive][restricted] policy as shown in the following the examples:
23
+
-**For common cases that do not require escalating privileges:** configure all containers to comply with the [restricted][restricted] policy as shown in the following the examples:
24
24
25
-
**On Kubernetes manifests:**
25
+
**IMPORTANT NOTE** The `seccompProfile` field to define that a container is [restricted][restricted] was introduced with K8s `1.19` and might **not** be supported on some vendors by default.
26
+
Please, do **not** use this field if you are looking to build Operators that work on K8s versions < `1.19` or on vendors that do **not** support this field. Having this field when it is not supported can result in your Pods/Containers **not** being allowed to run (i.e. On Openshift versions < `4.11` with its default configuration the deployments will fail with errors like `Forbidden: seccomp`.)
27
+
However, if you are developing solutions to be distributed on Kubernetes versions => `1.19` and or for example, Openshift versions >= `4.11` it is highly recommended that this field is used to
28
+
ensure that all your Pods/Containers are [restricted][restricted] unless they require escalated privileges.
29
+
30
+
**In Kubernetes manifests:**
26
31
27
32
```yaml
28
33
spec:
29
34
securityContext:
30
35
runAsNonRoot: true
36
+
# Please ensure that you can use SeccompProfile and do not use
37
+
# if your project must work on old Kubernetes
38
+
# versions < 1.19 or on vendors versions which
39
+
# do NOT support this field by default (i.e. Openshift < 4.11 )
31
40
seccompProfile:
32
41
type: RuntimeDefault
33
42
...
@@ -56,6 +65,10 @@ dep:= &appsv1.Deployment{
56
65
// Ensure restrictive context for the Pod
57
66
SecurityContext: &corev1.PodSecurityContext{
58
67
RunAsNonRoot: &[]bool{true}[0],
68
+
// Please ensure that you can use SeccompProfile and do NOT use
69
+
// this filed if your project must work on old Kubernetes
70
+
// versions < 1.19 or on vendors versions which
71
+
// do NOT support this field by default (i.e. Openshift < 4.11)
0 commit comments