Skip to content

Support pluggable logging #6639

@jmillikin-stripe

Description

@jmillikin-stripe

Containerd versions v1.3+ have support for log plugins, where a task is configured with the path to an external binary and the shim will invoke that binary to handle persisting log data. This functionality is roughly equivalent to Docker's logging drivers (https://docs.docker.com/config/containers/logging/plugins/).

The CRI plugin currently bypasses Containerd's log plugins, writing logs only to disk in a format and location determined by the Kubelet. This makes it difficult to use Containerd as the runtime for Kubernetes in a cluster where we want more precise control over log data.

Example policies that a custom log plugin might enforce include:

From a bit of digging into the CRI plugin I believe support for log plugins could be added into pkg/server/io/container_io.go or pkg/server/container_start.go, with the log plugin taking the place of ContainerdIO as a containerdio.Creator. Does this sound reasonable? I would be willing to implement support for this and shepherd it upstream if the CRI plugin maintainers are open to the idea.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions