1package configs
2
3type FreezerState string
4
5const (
6	Undefined FreezerState = ""
7	Frozen    FreezerState = "FROZEN"
8	Thawed    FreezerState = "THAWED"
9)
10
11type Cgroup struct {
12	// Deprecated, use Path instead
13	Name string `json:"name,omitempty"`
14
15	// name of parent of cgroup or slice
16	// Deprecated, use Path instead
17	Parent string `json:"parent,omitempty"`
18
19	// Path specifies the path to cgroups that are created and/or joined by the container.
20	// The path is assumed to be relative to the host system cgroup mountpoint.
21	Path string `json:"path"`
22
23	// ScopePrefix describes prefix for the scope name
24	ScopePrefix string `json:"scope_prefix"`
25
26	// Paths represent the absolute cgroups paths to join.
27	// This takes precedence over Path.
28	Paths map[string]string
29
30	// Resources contains various cgroups settings to apply
31	*Resources
32}
33
34type Resources struct {
35	// 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.
36	// Deprecated
37	AllowAllDevices *bool `json:"allow_all_devices,omitempty"`
38	// Deprecated
39	AllowedDevices []*Device `json:"allowed_devices,omitempty"`
40	// Deprecated
41	DeniedDevices []*Device `json:"denied_devices,omitempty"`
42
43	Devices []*Device `json:"devices"`
44
45	// Memory limit (in bytes)
46	Memory int64 `json:"memory"`
47
48	// Memory reservation or soft_limit (in bytes)
49	MemoryReservation int64 `json:"memory_reservation"`
50
51	// Total memory usage (memory + swap); set `-1` to enable unlimited swap
52	MemorySwap int64 `json:"memory_swap"`
53
54	// Kernel memory limit (in bytes)
55	KernelMemory int64 `json:"kernel_memory"`
56
57	// Kernel memory limit for TCP use (in bytes)
58	KernelMemoryTCP int64 `json:"kernel_memory_tcp"`
59
60	// CPU shares (relative weight vs. other containers)
61	CpuShares uint64 `json:"cpu_shares"`
62
63	// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
64	CpuQuota int64 `json:"cpu_quota"`
65
66	// CPU period to be used for hardcapping (in usecs). 0 to use system default.
67	CpuPeriod uint64 `json:"cpu_period"`
68
69	// How many time CPU will use in realtime scheduling (in usecs).
70	CpuRtRuntime int64 `json:"cpu_rt_quota"`
71
72	// CPU period to be used for realtime scheduling (in usecs).
73	CpuRtPeriod uint64 `json:"cpu_rt_period"`
74
75	// CPU to use
76	CpusetCpus string `json:"cpuset_cpus"`
77
78	// MEM to use
79	CpusetMems string `json:"cpuset_mems"`
80
81	// Process limit; set <= `0' to disable limit.
82	PidsLimit int64 `json:"pids_limit"`
83
84	// Specifies per cgroup weight, range is from 10 to 1000.
85	BlkioWeight uint16 `json:"blkio_weight"`
86
87	// Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, range is from 10 to 1000, cfq scheduler only
88	BlkioLeafWeight uint16 `json:"blkio_leaf_weight"`
89
90	// Weight per cgroup per device, can override BlkioWeight.
91	BlkioWeightDevice []*WeightDevice `json:"blkio_weight_device"`
92
93	// IO read rate limit per cgroup per device, bytes per second.
94	BlkioThrottleReadBpsDevice []*ThrottleDevice `json:"blkio_throttle_read_bps_device"`
95
96	// IO write rate limit per cgroup per device, bytes per second.
97	BlkioThrottleWriteBpsDevice []*ThrottleDevice `json:"blkio_throttle_write_bps_device"`
98
99	// IO read rate limit per cgroup per device, IO per second.
100	BlkioThrottleReadIOPSDevice []*ThrottleDevice `json:"blkio_throttle_read_iops_device"`
101
102	// IO write rate limit per cgroup per device, IO per second.
103	BlkioThrottleWriteIOPSDevice []*ThrottleDevice `json:"blkio_throttle_write_iops_device"`
104
105	// set the freeze value for the process
106	Freezer FreezerState `json:"freezer"`
107
108	// Hugetlb limit (in bytes)
109	HugetlbLimit []*HugepageLimit `json:"hugetlb_limit"`
110
111	// Whether to disable OOM Killer
112	OomKillDisable bool `json:"oom_kill_disable"`
113
114	// Tuning swappiness behaviour per cgroup
115	MemorySwappiness *uint64 `json:"memory_swappiness"`
116
117	// Set priority of network traffic for container
118	NetPrioIfpriomap []*IfPrioMap `json:"net_prio_ifpriomap"`
119
120	// Set class identifier for container's network packets
121	NetClsClassid uint32 `json:"net_cls_classid_u"`
122}
123