2015-02-01 11:56:27 +08:00
package configs
type FreezerState string
const (
Undefined FreezerState = ""
Frozen FreezerState = "FROZEN"
Thawed FreezerState = "THAWED"
)
2015-05-14 06:42:16 +08:00
// TODO Windows: This can be factored out in the future as Cgroups are not
// supported on the Windows platform.
2015-02-01 11:56:27 +08:00
type Cgroup struct {
2015-02-12 08:45:23 +08:00
Name string ` json:"name" `
2015-02-01 11:56:27 +08:00
// name of parent cgroup or slice
2015-02-12 08:45:23 +08:00
Parent string ` json:"parent" `
2015-02-01 11:56:27 +08:00
// If this is true allow access to any kind of device within the container. If false, allow access only to devices explicitly listed in the allowed_devices list.
2015-02-12 08:45:23 +08:00
AllowAllDevices bool ` json:"allow_all_devices" `
2015-02-01 11:56:27 +08:00
2015-02-12 08:45:23 +08:00
AllowedDevices [ ] * Device ` json:"allowed_devices" `
2015-02-01 11:56:27 +08:00
2015-03-31 16:36:00 +08:00
DeniedDevices [ ] * Device ` json:"denied_devices" `
2015-02-01 11:56:27 +08:00
// Memory limit (in bytes)
2015-02-12 08:45:23 +08:00
Memory int64 ` json:"memory" `
2015-02-01 11:56:27 +08:00
// Memory reservation or soft_limit (in bytes)
2015-02-12 08:45:23 +08:00
MemoryReservation int64 ` json:"memory_reservation" `
2015-02-01 11:56:27 +08:00
// Total memory usage (memory + swap); set `-1' to disable swap
2015-02-12 08:45:23 +08:00
MemorySwap int64 ` json:"memory_swap" `
2015-02-01 11:56:27 +08:00
2015-05-15 14:24:56 +08:00
// Kernel memory limit (in bytes)
KernelMemory int64 ` json:"kernel_memory" `
2015-02-01 11:56:27 +08:00
// CPU shares (relative weight vs. other containers)
2015-02-12 08:45:23 +08:00
CpuShares int64 ` json:"cpu_shares" `
2015-02-01 11:56:27 +08:00
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
2015-02-12 08:45:23 +08:00
CpuQuota int64 ` json:"cpu_quota" `
2015-02-01 11:56:27 +08:00
// CPU period to be used for hardcapping (in usecs). 0 to use system default.
2015-02-12 08:45:23 +08:00
CpuPeriod int64 ` json:"cpu_period" `
2015-02-01 11:56:27 +08:00
2015-05-14 20:42:10 +08:00
// How many time CPU will use in realtime scheduling (in usecs).
CpuRtRuntime int64 ` json:"cpu_quota" `
// CPU period to be used for realtime scheduling (in usecs).
CpuRtPeriod int64 ` json:"cpu_period" `
2015-02-01 11:56:27 +08:00
// CPU to use
2015-02-12 08:45:23 +08:00
CpusetCpus string ` json:"cpuset_cpus" `
2015-02-01 11:56:27 +08:00
// MEM to use
2015-02-12 08:45:23 +08:00
CpusetMems string ` json:"cpuset_mems" `
2015-02-01 11:56:27 +08:00
2015-04-17 15:27:21 +08:00
// IO read rate limit per cgroup per device, bytes per second.
BlkioThrottleReadBpsDevice string ` json:"blkio_throttle_read_bps_device" `
// IO write rate limit per cgroup per divice, bytes per second.
BlkioThrottleWriteBpsDevice string ` json:"blkio_throttle_write_bps_device" `
// IO read rate limit per cgroup per device, IO per second.
BlkioThrottleReadIOpsDevice string ` json:"blkio_throttle_read_iops_device" `
// IO write rate limit per cgroup per device, IO per second.
BlkioThrottleWriteIOpsDevice string ` json:"blkio_throttle_write_iops_device" `
2015-02-01 11:56:27 +08:00
// Specifies per cgroup weight, range is from 10 to 1000.
2015-02-12 08:45:23 +08:00
BlkioWeight int64 ` json:"blkio_weight" `
2015-02-01 11:56:27 +08:00
2015-04-08 14:11:29 +08:00
// Weight per cgroup per device, can override BlkioWeight.
BlkioWeightDevice string ` json:"blkio_weight_device" `
2015-02-01 11:56:27 +08:00
// set the freeze value for the process
2015-02-12 08:45:23 +08:00
Freezer FreezerState ` json:"freezer" `
2015-02-01 11:56:27 +08:00
// Parent slice to use for systemd TODO: remove in favor or parent
2015-02-12 08:45:23 +08:00
Slice string ` json:"slice" `
2015-03-07 02:37:56 +08:00
// Whether to disable OOM Killer
OomKillDisable bool ` json:"oom_kill_disable" `
2015-05-14 10:48:46 +08:00
// Set priority of network traffic for container
NetPrioIfpriomap [ ] * IfPrioMap ` json:"net_prio_ifpriomap" `
2015-05-14 09:09:14 +08:00
// Set class identifier for container's network packets
NetClsClassid string ` json:"net_cls_classid" `
2015-02-01 11:56:27 +08:00
}