Place containerd inside cgroup
This adds a config option to place the `containerd` daemon process into
a cgroup so that proper resource usage and accounting can be applied.
It defaults to not being place inside a cgroup and will create a new
cgroup if the `path` does not exist in the config or join an existing
`path` if it already exists.
```toml
[cgroup]
path = "/containerd"
```
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -25,6 +25,8 @@ type Config struct {
|
||||
Subreaper bool `toml:"subreaper"`
|
||||
// OOMScore adjust the containerd's oom score
|
||||
OOMScore int `toml:"oom_score"`
|
||||
// Cgroup specifies cgroup information for the containerd daemon process
|
||||
Cgroup CgroupConfig `toml:"cgroup"`
|
||||
|
||||
md toml.MetaData
|
||||
}
|
||||
@@ -46,6 +48,10 @@ type MetricsConfig struct {
|
||||
Address string `toml:"address"`
|
||||
}
|
||||
|
||||
type CgroupConfig struct {
|
||||
Path string `toml:"path"`
|
||||
}
|
||||
|
||||
// Decode unmarshals a plugin specific configuration by plugin id
|
||||
func (c *Config) Decode(id string, v interface{}) (interface{}, error) {
|
||||
data, ok := c.Plugins[id]
|
||||
|
||||
Reference in New Issue
Block a user