Add log size max configuration
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
a8ee86b1cc
commit
c7f5347673
2 changed files with 15 additions and 0 deletions
|
@ -108,6 +108,10 @@ hooks_dir_path = "{{ .HooksDirPath }}"
|
||||||
# pids_limit is the number of processes allowed in a container
|
# pids_limit is the number of processes allowed in a container
|
||||||
pids_limit = {{ .PidsLimit }}
|
pids_limit = {{ .PidsLimit }}
|
||||||
|
|
||||||
|
# log_size_max is the max limit for the container log size in bytes.
|
||||||
|
# Negative values indicate that no limit is imposed.
|
||||||
|
log_size_max = {{ .LogSizeMax }}
|
||||||
|
|
||||||
# The "crio.image" table contains settings pertaining to the
|
# The "crio.image" table contains settings pertaining to the
|
||||||
# management of OCI images.
|
# management of OCI images.
|
||||||
[crio.image]
|
[crio.image]
|
||||||
|
|
|
@ -51,6 +51,10 @@ const (
|
||||||
// DefaultPidsLimit is the default value for maximum number of processes
|
// DefaultPidsLimit is the default value for maximum number of processes
|
||||||
// allowed inside a container
|
// allowed inside a container
|
||||||
DefaultPidsLimit = 1024
|
DefaultPidsLimit = 1024
|
||||||
|
|
||||||
|
// DefaultLogSizeMax is the default value for the maximum log size
|
||||||
|
// allowed for a container. Negative values mean that no limit is imposed.
|
||||||
|
DefaultLogSizeMax = -1
|
||||||
)
|
)
|
||||||
|
|
||||||
// This structure is necessary to fake the TOML tables when parsing,
|
// This structure is necessary to fake the TOML tables when parsing,
|
||||||
|
@ -145,6 +149,12 @@ type RuntimeConfig struct {
|
||||||
// by the cgroup process number controller.
|
// by the cgroup process number controller.
|
||||||
PidsLimit int64 `toml:"pids_limit"`
|
PidsLimit int64 `toml:"pids_limit"`
|
||||||
|
|
||||||
|
// LogSizeMax is the maximum number of bytes after which the log file
|
||||||
|
// will be truncated. It can be expressed as a human-friendly string
|
||||||
|
// that is parsed to bytes.
|
||||||
|
// Negative values indicate that the log file won't be truncated.
|
||||||
|
LogSizeMax int64 `toml:"log_size_max"`
|
||||||
|
|
||||||
// ContainerExitsDir is the directory in which container exit files are
|
// ContainerExitsDir is the directory in which container exit files are
|
||||||
// written to by conmon.
|
// written to by conmon.
|
||||||
ContainerExitsDir string `toml:"container_exits_dir"`
|
ContainerExitsDir string `toml:"container_exits_dir"`
|
||||||
|
@ -274,6 +284,7 @@ func DefaultConfig() *Config {
|
||||||
PidsLimit: DefaultPidsLimit,
|
PidsLimit: DefaultPidsLimit,
|
||||||
ContainerExitsDir: containerExitsDir,
|
ContainerExitsDir: containerExitsDir,
|
||||||
HooksDirPath: DefaultHooksDirPath,
|
HooksDirPath: DefaultHooksDirPath,
|
||||||
|
LogSizeMax: DefaultLogSizeMax,
|
||||||
},
|
},
|
||||||
ImageConfig: ImageConfig{
|
ImageConfig: ImageConfig{
|
||||||
DefaultTransport: defaultTransport,
|
DefaultTransport: defaultTransport,
|
||||||
|
|
Loading…
Reference in a new issue