Documentation ¶
Index ¶
- Constants
- type Backend
- type Checkpoints
- type Client
- type EventInfo
- type EventType
- type Remote
- type RemoteOption
- func WithDebugAddress(addr string) RemoteOption
- func WithLogLevel(lvl string) RemoteOption
- func WithMetricsAddress(addr string) RemoteOption
- func WithOOMScore(score int) RemoteOption
- func WithPlugin(name string, conf interface{}) RemoteOption
- func WithRemoteAddr(addr string) RemoteOption
- func WithRemoteAddrUser(uid, gid int) RemoteOption
- func WithSnapshotter(name string) RemoteOption
- func WithStartDaemon(start bool) RemoteOption
- type Resources
- type Stats
- type Status
- type StdioCallback
- type Summary
Constants ¶
const InitProcessName = "init"
InitProcessName is the name given to the first process of a container
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Version(ctx context.Context) (containerd.Version, error) Restore(ctx context.Context, containerID string, attachStdio StdioCallback) (alive bool, pid int, err error) Create(ctx context.Context, containerID string, spec *specs.Spec, runtimeOptions interface{}) error Start(ctx context.Context, containerID, checkpointDir string, withStdin bool, attachStdio StdioCallback) (pid int, err error) SignalProcess(ctx context.Context, containerID, processID string, signal int) error Exec(ctx context.Context, containerID, processID string, spec *specs.Process, withStdin bool, attachStdio StdioCallback) (int, error) ResizeTerminal(ctx context.Context, containerID, processID string, width, height int) error CloseStdin(ctx context.Context, containerID, processID string) error Pause(ctx context.Context, containerID string) error Resume(ctx context.Context, containerID string) error Stats(ctx context.Context, containerID string) (*Stats, error) ListPids(ctx context.Context, containerID string) ([]uint32, error) Summary(ctx context.Context, containerID string) ([]Summary, error) DeleteTask(ctx context.Context, containerID string) (uint32, time.Time, error) Delete(ctx context.Context, containerID string) error Status(ctx context.Context, containerID string) (Status, error) UpdateResources(ctx context.Context, containerID string, resources *Resources) error CreateCheckpoint(ctx context.Context, containerID, checkpointDir string, exit bool) error }
Client provides access to containerd features.
type EventInfo ¶
type EventInfo struct { ContainerID string ProcessID string Pid uint32 ExitCode uint32 ExitedAt time.Time OOMKilled bool Error error }
EventInfo contains the event info
type EventType ¶
type EventType string
EventType represents a possible event from libcontainerd
const ( EventUnknown EventType = "unknown" EventExit EventType = "exit" EventOOM EventType = "oom" EventCreate EventType = "create" EventStart EventType = "start" EventExecAdded EventType = "exec-added" EventExecStarted EventType = "exec-started" EventPaused EventType = "paused" EventResumed EventType = "resumed" )
Event constants used when reporting events
type Remote ¶
type Remote interface { // Client returns a new Client instance connected with given Backend. NewClient(namespace string, backend Backend) (Client, error) // Cleanup stops containerd if it was started by libcontainerd. // Note this is not used on Windows as there is no remote containerd. Cleanup() }
Remote on Linux defines the accesspoint to the containerd grpc API. Remote on Windows is largely an unimplemented interface as there is no remote containerd.
type RemoteOption ¶
RemoteOption allows to configure parameters of remotes. This is unused on Windows.
func WithDebugAddress ¶
func WithDebugAddress(addr string) RemoteOption
WithDebugAddress defines at which location the debug GRPC connection should be made
func WithLogLevel ¶
func WithLogLevel(lvl string) RemoteOption
WithLogLevel defines which log level to starts containerd with. This only makes sense if WithStartDaemon() was set to true.
func WithMetricsAddress ¶
func WithMetricsAddress(addr string) RemoteOption
WithMetricsAddress defines at which location the debug GRPC connection should be made
func WithOOMScore ¶
func WithOOMScore(score int) RemoteOption
WithOOMScore defines the oom_score_adj to set for the containerd process.
func WithPlugin ¶
func WithPlugin(name string, conf interface{}) RemoteOption
WithPlugin allow configuring a containerd plugin configuration values passed needs to be quoted if quotes are needed in the toml format.
func WithRemoteAddr ¶
func WithRemoteAddr(addr string) RemoteOption
WithRemoteAddr sets the external containerd socket to connect to.
func WithRemoteAddrUser ¶
func WithRemoteAddrUser(uid, gid int) RemoteOption
WithRemoteAddrUser sets the uid and gid to create the RPC address with
func WithSnapshotter ¶
func WithSnapshotter(name string) RemoteOption
WithSnapshotter defines snapshotter driver should be used
func WithStartDaemon ¶
func WithStartDaemon(start bool) RemoteOption
WithStartDaemon defines if libcontainerd should also run containerd daemon.
type Resources ¶
type Resources specs.LinuxResources
Resources defines updatable container resource values. TODO: it must match containerd upcoming API
type Status ¶
type Status string
Status represents the current status of a container
const ( // Running indicates the process is currently executing StatusRunning Status = "running" // Created indicates the process has been created within containerd but the // user's defined process has not started StatusCreated Status = "created" // Stopped indicates that the process has ran and exited StatusStopped Status = "stopped" // Paused indicates that the process is currently paused StatusPaused Status = "paused" // Pausing indicates that the process is currently switching from a // running state into a paused state StatusPausing Status = "pausing" // Unknown indicates that we could not determine the status from the runtime StatusUnknown Status = "unknown" )
Possible container statuses
type StdioCallback ¶
StdioCallback is called to connect a container or process stdio.