@@ -92,9 +92,10 @@ Only _namespaced_ sysctls can be enabled this way.
92
92
93
93
A number of sysctls are _ namespaced_ in today's Linux kernels. This means that
94
94
they can be set independently for each pod on a node. Only namespaced sysctls
95
- are accessible in the pod security context within Kubernetes.
95
+ are configurable via the pod securityContext within Kubernetes.
96
96
97
- The following sysctls are _ namespaced_ :
97
+ The following sysctls are known to be namespaced. This list could change
98
+ in future versions of the Linux kernel.
98
99
99
100
- ` kernel.shm* ` ,
100
101
- ` kernel.msg* ` ,
@@ -106,8 +107,8 @@ Sysctls with no namespace are called _node-level_ sysctls. If you need to set
106
107
them, you must manually configure them on each node's operating system, or by
107
108
using a DaemonSet with privileged containers.
108
109
109
- For namespaced sysctls, use the pod securityContext to configure sysctls. They
110
- apply to all containers in the same pod.
110
+ Use the pod securityContext to configure namespaced sysctls. The securityContext
111
+ applies to all containers in the same pod.
111
112
112
113
This example uses the pod securityContext to set a safe sysctl
113
114
` kernel.shm_rmid_forced ` and two unsafe sysctls ` net.ipv4.route.min_pmtu ` and
@@ -159,23 +160,25 @@ to schedule those pods onto the right nodes.
159
160
160
161
## PodSecurityPolicy
161
162
162
- To control which sysctls can be set in pods, specify the
163
- ` forbiddenSysctls ` and/or ` allowedUnsafeSysctls ` fields in the PodSecurityPolicy.
163
+ You can further control which sysctls can be set in pods by specifying lists of
164
+ sysctls or sysctl patterns in the ` forbiddenSysctls ` and/or
165
+ ` allowedUnsafeSysctls ` fields of the PodSecurityPolicy. A sysctl pattern ends
166
+ with a ` * ` character, such as ` kernel.* ` . A ` * ` character on its own matches
167
+ all sysctls.
164
168
165
- By default, all safe sysctls in the whitelist are allowed.
169
+ By default, all safe sysctls are allowed.
166
170
167
171
Both ` forbiddenSysctls ` and ` allowedUnsafeSysctls ` are lists of plain sysctl names
168
172
or sysctl patterns (which end with ` * ` ). The string ` * ` matches all sysctls.
169
173
170
- The ` forbiddenSysctls ` field excludes specific sysctls, and can include a
171
- combination of safe and unsafe ones . To forbid setting any sysctls, use ` * ` on
172
- its own.
174
+ The ` forbiddenSysctls ` field excludes specific sysctls. You can forbid a
175
+ combination of safe and unsafe sysctls in the list . To forbid setting any
176
+ sysctls, use ` * ` on its own.
173
177
174
178
If you specify any unsafe sysctl in the ` allowedUnsafeSysctls ` field and it is
175
- not present in the ` forbiddenSysctls ` field, that sysctl can be used in Pods under
176
- this PodSecurityPolicy. In order to allow all unsafe sysctls in the PodSecurityPolicy
177
- to be set (except for those explicitly forbidden by ` forbiddenSysctls ` ),
178
- use ` * ` on its own.
179
+ not present in the ` forbiddenSysctls ` field, that sysctl can be used in Pods
180
+ using this PodSecurityPolicy. To allow all unsafe sysctls in the
181
+ PodSecurityPolicy to be set, use ` * ` on its own.
179
182
180
183
Do not configure these two fields such that there is overlap, meaning that a
181
184
given sysctl is both allowed and forbidden.
0 commit comments