Documentation
¶
Index ¶
- func IsParkedContainerLabels(labels map[string]string) bool
- func IsParkedSandboxID(id string) bool
- func PublishEngineTag(engine string)
- type Client
- func (c *Client) Close() error
- func (c *Client) ContentStore() content.Store
- func (c *Client) GetImage(ctx context.Context, ref string) (cntr.Image, error)
- func (c *Client) ListContainers(ctx context.Context, filters ...string) ([]cntr.Container, error)
- func (c *Client) LoadContainer(ctx context.Context, id string) (cntr.Container, error)
- func (c *Client) Namespace() string
- func (c *Client) NewContainer(ctx context.Context, id string, opts ...cntr.NewContainerOpts) (cntr.Container, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) PullImage(ctx context.Context, ref string, opts ...cntr.RemoteOpt) (cntr.Image, error)
- func (c *Client) Raw() *cntr.Client
- func (c *Client) SubscribeEvents(ctx context.Context, filters ...string) (<-chan *events.Envelope, <-chan error)
- type Config
- type Driver
- func (d *Driver) ApplyEgressPolicy(containerIP string, allowCIDRs, denyCIDRs []string) error
- func (d *Driver) ApplyNetworkBlockAll(containerIP string) error
- func (d *Driver) ApplyNetworkBlockIngress(containerIP string) error
- func (d *Driver) ClearEgressPolicy(containerIP string, allowCIDRs, denyCIDRs []string) error
- func (d *Driver) ClearNetworkBlockEgress(containerIP string) error
- func (d *Driver) ClearNetworkBlockIngress(containerIP string) error
- func (d *Driver) ClearNetworkRules(containerIP string) error
- func (d *Driver) ContainerPID(ctx context.Context, containerRef string) (int, error)
- func (d *Driver) Create(ctx context.Context, req models.CreateSandboxRequest, ...) (*models.SandboxRuntimeState, error)
- func (d *Driver) CreateSnapshot(ctx context.Context, containerRef, imageRef string) (string, error)
- func (d *Driver) Destroy(ctx context.Context, sandbox *models.Sandbox) error
- func (d *Driver) Inspect(ctx context.Context, containerRef string) (*models.SandboxRuntimeState, error)
- func (d *Driver) ListManaged(ctx context.Context) (map[string]*models.SandboxRuntimeState, error)
- func (d *Driver) Ping(ctx context.Context) error
- func (d *Driver) PurgeParkedContainers(ctx context.Context) (int, error)
- func (d *Driver) PushAllowedPorts(ctx context.Context, containerIP, toolboxToken string, ports []int) error
- func (d *Driver) RemoveImage(ctx context.Context, imageRef string) error
- func (d *Driver) Resize(ctx context.Context, containerRef string, req models.ResizeSandboxRequest) error
- func (d *Driver) SetClient(c *Client)
- func (d *Driver) SetNetnsHandoff(h NetnsHandoff)
- func (d *Driver) SetWarmPool(p WarmPool)
- func (d *Driver) Start(ctx context.Context, containerRef string) (*models.SandboxRuntimeState, error)
- func (d *Driver) Stop(ctx context.Context, containerRef string) error
- func (d *Driver) StreamEvents(ctx context.Context, out chan<- docker.DockerEvent) error
- type NetnsHandoff
- type PoolSpawner
- type RegistryPusher
- type WarmPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsParkedContainerLabels ¶
IsParkedContainerLabels reports warm-pool park inventory for ListManaged.
func IsParkedSandboxID ¶
IsParkedSandboxID reports park-<hex> slot ids.
func PublishEngineTag ¶
func PublishEngineTag(engine string)
PublishEngineTag stamps the host engine into expvar for operator dashboards.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a namespaced containerd connection.
func NewTestClient ¶
NewTestClient wires a fake or stub transport for unit tests.
func (*Client) ContentStore ¶
ContentStore exposes the backing content store for image config reads.
func (*Client) ListContainers ¶
func (*Client) LoadContainer ¶
func (*Client) NewContainer ¶
type Config ¶
type Config struct {
Socket string
Namespace string
ToolboxBinaryPath string
ToolboxMountPath string
ToolboxPort int
Privileged bool
ResourceLimitsOff bool
DefaultRuntime string
WaitTimeout time.Duration
ToolboxWaitTimeout time.Duration
ReadyEnabled bool
ReadyDir string
ReadinessPollInit time.Duration
ReadinessPollMax time.Duration
PullMaxConcurrent int
PullFailureBackoff time.Duration
HTTPClientTimeout time.Duration
LogDir string
RunDir string
NativeNetnsPool bool
}
Config holds containerd-driver settings projected from daemon config.
func FromDaemonConfig ¶
FromDaemonConfig maps internal config into driver-local settings.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements runtime.ContainerRuntime against a local containerd.
func New ¶
New constructs a Driver. The containerd connection is lazy — Ping and Create establish it on first use so unit tests can inject a fake client.
func (*Driver) ApplyEgressPolicy ¶
func (*Driver) ApplyNetworkBlockAll ¶
func (*Driver) ApplyNetworkBlockIngress ¶
func (*Driver) ClearEgressPolicy ¶
func (*Driver) ClearNetworkBlockEgress ¶
func (*Driver) ClearNetworkBlockIngress ¶
func (*Driver) ClearNetworkRules ¶
func (*Driver) ContainerPID ¶
ContainerPID returns the init PID for a running task. "Not running here" (no container / no task) is (0, nil) so the events mux can fall through to the other engine; genuine lookup failures propagate so netstats diagnostics aren't silently swallowed.
func (*Driver) Create ¶
func (d *Driver) Create(ctx context.Context, req models.CreateSandboxRequest, sandboxID, toolboxToken string, hostMounts []mounts.ContainerBind) (*models.SandboxRuntimeState, error)
Create provisions and starts a managed task in the aerolvm namespace.
func (*Driver) CreateSnapshot ¶
CreateSnapshot commits a running task filesystem into a new image in the aerolvm namespace (plans/containerd-engine.md Phase 3).
func (*Driver) ListManaged ¶
func (*Driver) PurgeParkedContainers ¶
PurgeParkedContainers destroys park-labeled containers left from a prior run.
func (*Driver) PushAllowedPorts ¶
func (*Driver) RemoveImage ¶
func (*Driver) SetNetnsHandoff ¶
func (d *Driver) SetNetnsHandoff(h NetnsHandoff)
SetNetnsHandoff wires the native netns pool (Phase 2). Nil disables it.
func (*Driver) SetWarmPool ¶
SetWarmPool wires the containerd warm pool (Phase 3). Nil disables it.
func (*Driver) StreamEvents ¶
StreamEvents subscribes to containerd task lifecycle events for managed workloads and normalizes them into docker.DockerEvent for the service event monitor.
type NetnsHandoff ¶
type NetnsHandoff interface {
Provision(ctx context.Context, sandboxID string) (netnsPath, containerIP string, err error)
Release(ctx context.Context, sandboxID string) error
// ReassignOwner moves adopted slot ownership from a park slot id to the
// real sandbox id after warm adopt (rename-free).
ReassignOwner(ctx context.Context, fromSandboxID, toSandboxID string) error
}
NetnsHandoff provisions a prepaid network namespace for containerd creates. When nil, the driver uses containerd's default network namespace (host/default).
type PoolSpawner ¶
type PoolSpawner struct {
Driver *Driver
}
PoolSpawner implements containerdpool.Spawner against the containerd driver.
func (*PoolSpawner) DestroyParked ¶
func (p *PoolSpawner) DestroyParked(ctx context.Context, slot *containerdpool.ParkedSlot) error
func (*PoolSpawner) Park ¶
func (p *PoolSpawner) Park(ctx context.Context, slotID string, key containerdpool.Key) (*containerdpool.ParkedSlot, error)
type RegistryPusher ¶
type RegistryPusher struct {
// contains filtered or unexported fields
}
RegistryPusher pushes local aerolvm-namespace images to a remote registry (AOCR snapshot path). Implements service.SnapshotPushDocker so the existing SnapshotPusher / reconciler work unchanged under SB_CONTAINER_ENGINE=containerd.
func NewRegistryPusher ¶
func NewRegistryPusher(d *Driver) *RegistryPusher
NewRegistryPusher returns a SnapshotPushDocker backed by the containerd driver.
func (*RegistryPusher) PushImage ¶
func (p *RegistryPusher) PushImage(ctx context.Context, req docker.PushImageRequest) (string, error)
PushImage tags SourceTag as DestRef in the aerolvm namespace and pushes it.
type WarmPool ¶
type WarmPool interface {
HasReady(key containerdpool.Key) bool
Acquire(ctx context.Context, key containerdpool.Key, imageID string) (*containerdpool.ParkedSlot, error)
NoteMiss(key containerdpool.Key)
ReleasePark(slotID string)
}
WarmPool is the Phase 3 park/adopt seam. Nil disables warm acquisition.
Source Files
¶
- client.go
- client_test_seam.go
- client_transport.go
- driver.go
- events.go
- hosts.go
- image_config.go
- image_lease.go
- lifecycle.go
- logio.go
- metrics.go
- netns_handoff.go
- network_ip.go
- network_ip_linux.go
- network_rules.go
- push.go
- runsc_config.go
- runtime_gvisor.go
- security.go
- snapshot.go
- validate.go
- version.go
- warm_adopt.go
- warm_park.go
- warm_pool.go