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
Sysctls are grouped into _safe_ and _unsafe_ sysctls. In addition to proper
73
74
namespacing, a safe sysctl must be properly isolated between pods on the same
74
-
node. This means that setting a safe sysctl for one pod:
75
+
node. This means that if you set a sysctl as safe for one pod it must not:
75
76
76
-
- must not have any influence on any other pod on the node,
77
-
- must not allow to harm the node's health, and
78
-
- must not allow to gain CPU or memory resources outside of the resource limits of
79
-
a pod.
77
+
- Influence any other pod on the node
78
+
- Harm the node's health
79
+
- Gain CPU or memory resources outside of the resource limits of a pod
80
80
81
81
By far, most of the namespaced sysctls are not necessarily considered safe.
82
82
83
-
For {product-title} 3.3.1, the following sysctls are supported (whitelisted) in
84
-
the safe set:
83
+
Currently, {product-title} supports, or whitelists, the following sysctls
84
+
in the safe set:
85
85
86
86
- *_kernel.shm_rmid_forced_*
87
87
- *_net.ipv4.ip_local_port_range_*
88
+
- *_net.ipv4.tcp_syncookies_*
88
89
89
-
This list will be extended in future versions when the kubelet supports better
90
+
This list might be extended in future versions when the kubelet supports better
90
91
isolation mechanisms.
91
92
92
93
All safe sysctls are enabled by default. All unsafe sysctls are disabled by
93
-
default and must be allowed manually by the cluster administrator on a per-node
94
-
basis. Pods with disabled unsafe sysctls will be scheduled, but will fail to
94
+
default, and the cluster administrator must manually enable them on a per-node
95
+
basis. Pods with disabled unsafe sysctls will be scheduled but will fail to
95
96
launch.
96
97
98
+
[[enabling-unsafe-sysctls]]
99
+
== Enabling unsafe sysctls
100
+
101
+
The cluster administrator can allow certain unsafe sysctls for very special
102
+
situations such as high-performance or real-time application tuning.
103
+
104
+
If you want to use unsafe sysctls, cluster administrators must enable them
105
+
individually on nodes. They can enable only namespaced sysctls.
106
+
97
107
[WARNING]
98
108
====
99
109
Due to their nature of being unsafe, the use of unsafe sysctls is
100
110
at-your-own-risk and can lead to severe problems like wrong behavior of
101
111
containers, resource shortage, or complete breakage of a node.
102
112
====
103
113
104
-
[[enabling-unsafe-sysctls]]
105
-
== Enabling Unsafe Sysctls
106
-
107
-
With the warning above in mind, the cluster administrator can allow certain
108
-
unsafe sysctls for very special situations, e.g., high-performance or real-time
109
-
application tuning.
110
-
111
-
If you want to use unsafe sysctls, cluster administrators must enable them
112
-
individually on nodes. Only namespaced sysctls can be enabled this way.
113
-
114
-
. Specify the unsafe sysctls to use as the value of the `kubeletArguments`\ parameter in the appropriate xref:../admin_guide/manage_nodes.adoc#modifying-nodes[node configuration map]
115
-
file, as described in xref:../admin_guide/manage_nodes.adoc#configuring-node-resources[Configuring Node Resources]:
114
+
. Use the `*kubeletArguments*` field in the *_/etc/origin/node/node-config.yaml_*
115
+
file, as described in
116
+
xref:../admin_guide/manage_nodes.adoc#configuring-node-resources[Configuring Node Resources], to set the desired unsafe sysctls:
116
117
+
117
118
----
118
119
kubeletArguments:
@@ -134,31 +135,49 @@ ifdef::openshift-origin[]
134
135
endif::[]
135
136
136
137
[[setting-sysctls-for-a-pod]]
137
-
== Setting Sysctls for a Pod
138
+
== Setting sysctls for a pod
139
+
140
+
Sysctls are set on pods using the pod's `securityContext`. The `securityContext`
141
+
applies to all containers in the same pod.
142
+
143
+
The following example uses the pod `securityContext` to set a safe sysctl
144
+
`kernel.shm_rmid_forced` and two unsafe sysctls, `net.ipv4.route.min_pmtu` and
145
+
`kernel.msgmax`. There is no distinction between _safe_ and _unsafe_ sysctls in
146
+
the specification.
138
147
139
-
Sysctls are set on pods using annotations. They apply to all containers in the
140
-
same pod.
148
+
[WARNING]
149
+
====
150
+
To avoid destabilizing your operating system, modify sysctl parameters only
151
+
after you understand their effects.
152
+
====
141
153
142
-
Here is an example, with different annotations for safe and unsafe sysctls:
154
+
Modify the YAML file that defines the pod and add the `securityContext` spec, as
0 commit comments