Documentation
¶
Index ¶
- Constants
- Variables
- func FinishRestore(ctx context.Context, id string, cfg *Config, startTime time.Time) error
- func GetNetworkNS(spec *specs.Spec) (string, error)
- func GetPIDNS(spec *specs.Spec) (string, error)
- func GetSpec(bundlePath string) (*specs.Spec, error)
- func MigrationRestore(ctx context.Context, r *task.CreateTaskRequest, cfg *Config) (skipStart bool, err error)
- type Config
- type Container
- func (c *Container) AddCheckpointedPID(pid int)
- func (c *Container) CancelScaleDown()
- func (c *Container) CheckpointedPID(pid int) bool
- func (c *Container) Config() *Config
- func (c *Container) DeleteCheckpointedPID(pid int)
- func (c *Container) Evac(ctx context.Context, scaledDown bool) error
- func (c *Container) GetMetrics() *v1.ContainerMetrics
- func (c *Container) ID() string
- func (c *Container) InitialProcess() process.Process
- func (c *Container) MigrationEnabled() bool
- func (c *Container) Process() process.Process
- func (c *Container) Register(ctx context.Context, container *runc.Container) error
- func (c *Container) RegisterPostRestore(f func(*runc.Container, HandleStartedFunc))
- func (c *Container) RegisterPreRestore(f func() HandleStartedFunc)
- func (c *Container) Restore(ctx context.Context) (*runc.Container, process.Process, error)
- func (c *Container) ScaledDown() bool
- func (c *Container) ScheduleScaleDown() error
- func (c *Container) SetScaledDown(scaledDown bool)
- func (c *Container) SetSkipStart(skip bool)
- func (c *Container) SkipStart() bool
- func (c *Container) Status() *v1.ContainerStatus
- func (c *Container) Stop(ctx context.Context)
- func (c *Container) StopActivator(ctx context.Context)
- type HandleStartedFunc
Constants ¶
View Source
const ( NodeLabel = "zeropod.ctrox.dev/node" PortsAnnotationKey = "zeropod.ctrox.dev/ports-map" ContainerNamesAnnotationKey = "zeropod.ctrox.dev/container-names" ScaleDownDurationAnnotationKey = "zeropod.ctrox.dev/scaledown-duration" DisableCheckpoiningAnnotationKey = "zeropod.ctrox.dev/disable-checkpointing" PreDumpAnnotationKey = "zeropod.ctrox.dev/pre-dump" MigrateAnnotationKey = "zeropod.ctrox.dev/migrate" LiveMigrateAnnotationKey = "zeropod.ctrox.dev/live-migrate" CRIContainerNameAnnotation = "io.kubernetes.cri.container-name" CRIContainerTypeAnnotation = "io.kubernetes.cri.container-type" CRIPodNameAnnotation = "io.kubernetes.cri.sandbox-name" CRIPodNamespaceAnnotation = "io.kubernetes.cri.sandbox-namespace" CRIPodUIDAnnotation = "io.kubernetes.cri.sandbox-uid" )
View Source
const RuntimeName = "io.containerd.zeropod.v2"
Variables ¶
View Source
var ( ErrAlreadyRestored = errors.New("container is already restored") ErrRestoreRequestFailed = errors.New("restore request failed") )
Functions ¶
func FinishRestore ¶
func GetNetworkNS ¶
GetNetworkNS reads the bundle's OCI spec and returns the network NS path of the container.
Types ¶
type Config ¶
type Config struct { ZeropodContainerNames []string Ports []uint16 ScaleDownDuration time.Duration DisableCheckpointing bool PreDump bool Migrate []string LiveMigrate string ContainerName string ContainerType string PodName string PodNamespace string PodUID string ContainerdNamespace string // contains filtered or unexported fields }
func NewConfig ¶
NewConfig uses the annotations from the container spec to create a new typed ZeropodConfig config.
func (Config) AnyMigrationEnabled ¶
func (Config) IsZeropodContainer ¶
func (Config) LiveMigrationEnabled ¶
type Container ¶
func (*Container) AddCheckpointedPID ¶
AddCheckpointedPID registers a new pid that should be considered checkpointed.
func (*Container) CancelScaleDown ¶
func (c *Container) CancelScaleDown()
func (*Container) CheckpointedPID ¶
CheckpointedPID indicates if the pid has been checkpointed before.
func (*Container) DeleteCheckpointedPID ¶
DeleteCheckpointedPID deletes a pid from the map of checkpointed pids.
func (*Container) GetMetrics ¶
func (c *Container) GetMetrics() *v1.ContainerMetrics
func (*Container) InitialProcess ¶
func (*Container) MigrationEnabled ¶
func (*Container) RegisterPostRestore ¶
func (c *Container) RegisterPostRestore(f func(*runc.Container, HandleStartedFunc))
func (*Container) RegisterPreRestore ¶
func (c *Container) RegisterPreRestore(f func() HandleStartedFunc)
func (*Container) ScaledDown ¶
func (*Container) ScheduleScaleDown ¶
func (*Container) SetScaledDown ¶
func (*Container) SetSkipStart ¶
func (*Container) Status ¶
func (c *Container) Status() *v1.ContainerStatus
func (*Container) StopActivator ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package io has been copied from https://github.com/containerd/containerd/tree/c07fb699a9a0c9792d21a759c87d0d60de11bfb9/internal/cri/io with some small changes to avoid importing k8s.io/cri-api (except in tests) and github.com/docker/go-metrics
|
Package io has been copied from https://github.com/containerd/containerd/tree/c07fb699a9a0c9792d21a759c87d0d60de11bfb9/internal/cri/io with some small changes to avoid importing k8s.io/cri-api (except in tests) and github.com/docker/go-metrics |
Click to show internal directories.
Click to hide internal directories.