@@ -131,6 +131,60 @@ Also known as cgroups, they are used to restrict resource usage for a container
131131cgroups provide controls to restrict cpu, memory, IO, pids and network for the container.
132132For more information, see the [ kernel cgroups documentation] ( https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt ) .
133133
134+ The path to the cgroups can to be specified in the Spec via ` cgroupsPath ` .
135+ ` cgroupsPath ` is expected to be relative to the cgroups mount point.
136+ If not specified, cgroups will be created under '/'.
137+ Implementations of the Spec can choose to name cgroups in any manner.
138+ The Spec does not include naming schema for cgroups.
139+ The Spec does not support [ split hierarchy] ( https://www.kernel.org/doc/Documentation/cgroups/unified-hierarchy.txt ) .
140+ The cgroups will be created if they don't exist.
141+
142+ ``` json
143+ "cgroupsPath" : " /myRuntime/myContainer"
144+ ```
145+
146+ ` cgroupsPath ` can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.
147+
148+ Optionally, cgroups limits can be specified via ` resources ` .
149+
150+ ``` json
151+ "resources" : {
152+ "disableOOMKiller" : false ,
153+ "memory" : {
154+ "limit" : 0 ,
155+ "reservation" : 0 ,
156+ "swap" : 0 ,
157+ "kernel" : 0 ,
158+ "swappiness" : -1
159+ },
160+ "cpu" : {
161+ "shares" : 0 ,
162+ "quota" : 0 ,
163+ "period" : 0 ,
164+ "realtimeRuntime" : 0 ,
165+ "realtimePeriod" : 0 ,
166+ "cpus" : " " ,
167+ "mems" : " "
168+ },
169+ "blockIO" : {
170+ "blkioWeight" : 0 ,
171+ "blkioWeightDevice" : " " ,
172+ "blkioThrottleReadBpsDevice" : " " ,
173+ "blkioThrottleWriteBpsDevice" : " " ,
174+ "blkioThrottleReadIopsDevice" : " " ,
175+ "blkioThrottleWriteIopsDevice" : " "
176+ },
177+ "hugepageLimits" : null ,
178+ "network" : {
179+ "classId" : " " ,
180+ "priorities" : null
181+ }
182+ }
183+ ```
184+
185+ Do not specify ` resources ` unless limits have to be updated.
186+ For example, to run a new process in an existing container without updating limits, ` resources ` need not be specified.
187+
134188## Sysctl
135189
136190sysctl allows kernel parameters to be modified at runtime for the container.
0 commit comments