Documentation
¶
Index ¶
- Constants
- Variables
- func CopyDir(src, dst string) error
- func GetExternalDirectoriesForCheckpoint() []string
- func GetExternalDirectoriesForRestore() []string
- func GetKubePodFilePaths(imageDir string) (map[string]string, error)
- func RestoreWithCmd(imageDir string) error
- func TakeCheckpoint(c *criu.Criu, pid int, configuration Configuration) (time.Duration, error)
- type Actions
- func (a Actions) NetworkLock() error
- func (a Actions) NetworkUnlock() error
- func (a Actions) PostDump() error
- func (a Actions) PostRestore(pid int32) error
- func (a Actions) PostResume() error
- func (a Actions) PostSetupNamespaces() error
- func (a Actions) PreDump() error
- func (a Actions) PreRestore() error
- func (a Actions) SetupNamespaces(_ int32) error
- type Configuration
- type DirectoryMount
Constants ¶
View Source
const (
ConfigurationFileName = "configuration.yaml"
)
Variables ¶
View Source
var ( // DirectoryMounts is the list of directories that are mounted by the container runtime and need to be marked as // such during checkpoint and restore so that the underlying files can change without breaking the restore process. DirectoryMounts = []DirectoryMount{ { Name: "zoneinfo", PathInCheckpoint: "/usr/share/zoneinfo", PathInRestore: "/usr/share/zoneinfo", }, { Name: "null", PathInCheckpoint: "/dev/null", PathInRestore: "/dev/null", }, { Name: "random", PathInCheckpoint: "/dev/random", PathInRestore: "/dev/random", }, { Name: "urandom", PathInCheckpoint: "/dev/urandom", PathInRestore: "/dev/urandom", }, { Name: "tty", PathInCheckpoint: "/dev/tty", PathInRestore: "/dev/tty", }, { Name: "zero", PathInCheckpoint: "/dev/zero", PathInRestore: "/dev/zero", }, { Name: "full", PathInCheckpoint: "/dev/full", PathInRestore: "/dev/full", }, } )
Functions ¶
func GetExternalDirectoriesForCheckpoint ¶
func GetExternalDirectoriesForCheckpoint() []string
func GetExternalDirectoriesForRestore ¶
func GetExternalDirectoriesForRestore() []string
func RestoreWithCmd ¶
func TakeCheckpoint ¶
func TakeCheckpoint(c *criu.Criu, pid int, configuration Configuration) (time.Duration, error)
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
func (Actions) PostRestore ¶
PostRestore does nothing.
func (Actions) PostSetupNamespaces ¶
PostSetupNamespaces does nothing.
func (Actions) SetupNamespaces ¶
SetupNamespaces does nothing.
type Configuration ¶
type Configuration struct { // ImageDir is the directory where the checkpoint is stored. It is expected to be available in the new container as // well. ImageDir string `json:"imageDir"` // NodeStateServerURL is the URL of the node state server. If given, crik will first check if the node is in shutting // down state and only then take checkpoint. // If not given, crik will always take checkpoint when it receives SIGTERM. NodeStateServerURL string `json:"nodeStateServerURL"` // AdditionalPaths is the list of paths that are not part of the container's image but were opened by one of the // processes in the tree. We need to make sure that these paths are available in the new container as well. // The paths are relative to the root of the container's filesystem. // Entries can be path to a file or a directory. AdditionalPaths []string `json:"additionalPaths,omitempty"` // InotifyIncompatiblePaths is the list of paths that are known to cause issues with inotify. We delete those paths // before taking the checkpoint. InotifyIncompatiblePaths []string `json:"inotifyIncompatiblePaths,omitempty"` }
Configuration lets crik know about quirks of the processes whose checkpoint is being taken. For example, the files that need to be part of the checkpoint but are not part of the container's image need to be specified here.
func ReadConfiguration ¶
func ReadConfiguration(path string) (Configuration, error)
type DirectoryMount ¶
Click to show internal directories.
Click to hide internal directories.