Documentation ¶
Index ¶
- Constants
- Variables
- func GetNetworkNS(spec *specs.Spec) (string, error)
- func GetPIDNS(spec *specs.Spec) (string, error)
- func GetSpec(bundlePath string) (*specs.Spec, error)
- func NewRegistry() *prometheus.Registry
- type Config
- type Container
- func (c *Container) AddCheckpointedPID(pid int)
- func (c *Container) CancelScaleDown()
- func (c *Container) CheckpointedPID(pid int) bool
- func (c *Container) DeleteCheckpointedPID(pid int)
- func (c *Container) ID() string
- func (c *Container) InitialProcess() process.Process
- func (c *Container) Process() process.Process
- 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) 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" CRIContainerNameAnnotation = "io.kubernetes.cri.container-name" CRIContainerTypeAnnotation = "io.kubernetes.cri.container-type" )
View Source
const ( LabelPodName = "pod" LabelPodNamespace = "namespace" MetricsNamespace = "zeropod" MetricCheckPointDuration = "checkpoint_duration_seconds" MetricRestoreDuration = "restore_duration_seconds" MetricLastCheckpointTime = "last_checkpoint_time" MetricLastRestoreTime = "last_restore_time" MetricRunning = "running" )
View Source
const RuntimeName = "io.containerd.zeropod.v2"
Variables ¶
View Source
var ErrAlreadyRestored = errors.New("container is already restored")
Functions ¶
func GetNetworkNS ¶
GetNetworkNS reads the bundle's OCI spec and returns the network NS path of the container.
func GetPIDNS ¶ added in v0.0.2
GetPIDNS reads the bundle's OCI spec and returns the PID NS path of the container.
func NewRegistry ¶ added in v0.3.0
func NewRegistry() *prometheus.Registry
Types ¶
type Config ¶
type Config struct { ZeropodContainerNames []string Ports []uint16 ScaleDownDuration time.Duration DisableCheckpointing bool PreDump bool 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) IsZeropodContainer ¶ added in v0.0.2
type Container ¶
func (*Container) AddCheckpointedPID ¶ added in v0.4.1
AddCheckpointedPID registers a new pid that should be considered checkpointed.
func (*Container) CancelScaleDown ¶
func (c *Container) CancelScaleDown()
func (*Container) CheckpointedPID ¶ added in v0.4.1
CheckpointedPID indicates if the pid has been checkpointed before.
func (*Container) DeleteCheckpointedPID ¶ added in v0.4.1
DeleteCheckpointedPID deletes a pid from the map of checkpointed pids.
func (*Container) InitialProcess ¶
func (*Container) RegisterPostRestore ¶ added in v0.2.0
func (c *Container) RegisterPostRestore(f func(*runc.Container, HandleStartedFunc))
func (*Container) RegisterPreRestore ¶ added in v0.2.0
func (c *Container) RegisterPreRestore(f func() HandleStartedFunc)
func (*Container) ScaledDown ¶
func (*Container) ScheduleScaleDown ¶
func (*Container) SetScaledDown ¶
func (*Container) Status ¶ added in v0.3.0
func (c *Container) Status() *v1.ContainerStatus
func (*Container) StopActivator ¶
Click to show internal directories.
Click to hide internal directories.