kubernetes: k8s.io/kubernetes/pkg/kubelet/logs Index | Files

package logs

import "k8s.io/kubernetes/pkg/kubelet/logs"


Package Files

container_log_manager.go container_log_manager_stub.go

func GetAllLogs Uses

func GetAllLogs(log string) ([]string, error)

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 Uses

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`.

type ContainerLogManager Uses

type ContainerLogManager interface {
    // TODO(random-liu): Add RotateLogs function and call it under disk pressure.
    // Start container log manager.

ContainerLogManager manages lifecycle of all container logs.

Implementation is thread-safe.

func NewContainerLogManager Uses

func NewContainerLogManager(runtimeService internalapi.RuntimeService, maxSize string, maxFiles int) (ContainerLogManager, error)

NewContainerLogManager creates a new container log manager.

func NewStubContainerLogManager Uses

func NewStubContainerLogManager() ContainerLogManager

NewStubContainerLogManager returns an empty ContainerLogManager which does nothing.

type LogRotatePolicy Uses

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.

Package logs imports 14 packages (graph) and is imported by 1 packages. Updated 2019-04-16. Refresh now. Tools for package owners.