package logs
import "k8s.io/kubernetes/pkg/kubelet/logs"
Index ¶
- func GetAllLogs(log string) ([]string, error)
- func UncompressLog(log string) (_ io.ReadCloser, retErr error)
- type ContainerLogManager
- func NewContainerLogManager(runtimeService internalapi.RuntimeService, maxSize string, maxFiles int) (ContainerLogManager, error)
- func NewStubContainerLogManager() ContainerLogManager
- type LogRotatePolicy
Functions ¶
func GetAllLogs ¶
GetAllLogs gets all inuse (rotated/compressed) logs for a specific container log. Returned logs are sorted in oldest to newest order. TODO(#59902): Leverage this function to support log rotation in `kubectl logs`.
func UncompressLog ¶
func UncompressLog(log string) (_ io.ReadCloser, retErr error)
UncompressLog compresses a compressed log and return a readcloser for the stream of the uncompressed content. TODO(#59902): Leverage this function to support log rotation in `kubectl logs`.
Types ¶
type ContainerLogManager ¶
type ContainerLogManager interface {
// TODO(random-liu): Add RotateLogs function and call it under disk pressure.
// Start container log manager.
Start()
}
ContainerLogManager manages lifecycle of all container logs.
Implementation is thread-safe.
func NewContainerLogManager ¶
func NewContainerLogManager(runtimeService internalapi.RuntimeService, maxSize string, maxFiles int) (ContainerLogManager, error)
NewContainerLogManager creates a new container log manager.
func NewStubContainerLogManager ¶
func NewStubContainerLogManager() ContainerLogManager
NewStubContainerLogManager returns an empty ContainerLogManager which does nothing.
type LogRotatePolicy ¶
type LogRotatePolicy struct {
// MaxSize in bytes of the container log file before it is rotated. Negative
// number means to disable container log rotation.
MaxSize int64
// MaxFiles is the maximum number of log files that can be present.
// If rotating the logs creates excess files, the oldest file is removed.
MaxFiles int
}
LogRotatePolicy is a policy for container log rotation. The policy applies to all containers managed by kubelet.
Source Files ¶
container_log_manager.go container_log_manager_stub.go
- Version
- v1.10.7-beta.0
- Published
- Jul 26, 2018
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 2 minutes ago –
Tools for package owners.