stage0

package
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2017 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidOSArch = map[string][]string{
	"linux": {"amd64", "i386", "aarch64", "aarch64_be", "armv6l", "armv7l", "armv7b", "ppc64le"},
}

ValidOSArch contains the supported ACI image OS/architecture combinations.

Functions

func AddApp added in v1.16.0

func AddApp(cfg AddConfig) error

func CheckMdsAvailability added in v0.9.0

func CheckMdsAvailability() error

CheckMdsAvailability checks whether a local metadata service can be reached.

func Enter added in v0.2.0

func Enter(cdir string, podPID int, appName types.ACName, stage1Path string, cmdline []string) error

Enter enters the pod/app by exec()ing the stage1's /enter similar to /init /enter can expect to have its CWD set to the app root. appName and command are supplied to /enter on argv followed by any arguments. stage1Path is the path of the stage1 rootfs

func GC added in v0.5.4

func GC(pdir string, uuid *types.UUID, localConfig string) error

GC enters the pod by fork/exec()ing the stage1's /gc similar to /init. /gc can expect to have its CWD set to the pod root.

func InitDebug added in v0.10.0

func InitDebug()

InitDebug enables debugging

func MergeMounts added in v0.10.0

func MergeMounts(mounts []schema.Mount, appMounts []schema.Mount) []schema.Mount

MergeMounts combines the global and per-app mount slices

func MountGC added in v0.14.0

func MountGC(path, uuid string) error

MountGC removes mounts from pods that couldn't be GCed cleanly.

func Prepare added in v0.4.0

func Prepare(cfg PrepareConfig, dir string, uuid *types.UUID) error

Prepare sets up a pod based on the given config.

func RmApp added in v1.16.0

func RmApp(cfg RmConfig) error

func Run

func Run(cfg RunConfig, dir string, dataDir string)

Run mounts the right overlay filesystems and actually runs the prepared pod by exec()ing the stage1 init inside the pod filesystem.

func StartApp added in v1.16.0

func StartApp(cfg StartConfig) error

func StopApp added in v1.16.0

func StopApp(cfg StopConfig) error

func StopPod added in v1.10.0

func StopPod(dir string, force bool, uuid *types.UUID) error

StopPod stops the given pod.

Types

type AddConfig added in v1.19.0

type AddConfig struct {
	*CommonConfig
	Image                types.Hash
	Apps                 *apps.Apps
	RktGid               int
	UsesOverlay          bool
	PodPath              string
	PodPID               int
	InsecureCapabilities bool
	InsecurePaths        bool
	InsecureSeccomp      bool
}

type CommonConfig added in v0.4.0

type CommonConfig struct {
	DataDir      string            // The path to the data directory, e.g. /var/lib/rkt/pods
	Store        *imagestore.Store // store containing all of the configured application images
	TreeStore    *treestore.Store  // store containing all of the configured application images
	Stage1Image  types.Hash        // stage1 image containing usable /init and /enter entrypoints
	UUID         *types.UUID       // UUID of the pod
	RootHash     string            // Hash of the root filesystem
	ManifestData string            // The pod manifest data
	Debug        bool
	MountLabel   string // selinux label to use for fs
	ProcessLabel string // selinux label to use
	Mutable      bool   // whether this pod is mutable
}

CommonConfig defines the configuration shared by both Run and Prepare

type CrossingEntrypoint added in v1.20.0

type CrossingEntrypoint struct {
	PodPath        string
	PodPID         int
	AppName        string
	EntrypointName string
	EntrypointArgs []string
	Interactive    bool
}

CrossingEntrypoint represents a stage1 entrypoint whose execution needs to cross the stage0/stage1/stage2 boundary.

func (CrossingEntrypoint) Run added in v1.20.0

func (ce CrossingEntrypoint) Run() error

Run wraps the execution of a stage1 entrypoint which requires crossing the stage0/stage1/stage2 boundary during its execution, by setting up proper environment variables for enter.

type DNSConfMode added in v1.15.0

type DNSConfMode struct {
	Resolv string // /etc/rkt-resolv.conf
	Hosts  string // /etc/rkt-hosts
}

DNSConfMode indicates what the stage1 should do with dns config files The values and meanings are: 'host': bind-mount from host 'stage0': the stage0 has generated it 'none' : do not generate it 'default' : do whatever was the default

type HostsEntries added in v1.15.0

type HostsEntries map[string][]string

HostsEntries encapsulates the entries in an etc-hosts file: mapping from IP to arbitrary list of hostnames

type PrepareConfig added in v0.4.0

type PrepareConfig struct {
	*CommonConfig
	Apps               *apps.Apps            // apps to prepare
	InheritEnv         bool                  // inherit parent environment into apps
	ExplicitEnv        []string              // always set these environment variables for all the apps
	EnvFromFile        []string              // environment variables loaded from files, set for all the apps
	Ports              []types.ExposedPort   // list of ports that rkt will expose on the host
	UseOverlay         bool                  // prepare pod with overlay fs
	SkipTreeStoreCheck bool                  // skip checking the treestore before rendering
	PodManifest        string                // use the pod manifest specified by the user, this will ignore flags such as '--volume', '--port', etc.
	PrivateUsers       *user.UidRange        // user namespaces
	UserAnnotations    types.UserAnnotations // user annotations for the pod.
	UserLabels         types.UserLabels      // user labels for the pod.
}

PrepareConfig defines the configuration parameters required by Prepare

type RmConfig added in v1.19.0

type RmConfig struct {
	*CommonConfig
	PodPath     string
	UsesOverlay bool
	AppName     *types.ACName
	PodPID      int
}

type RunConfig added in v0.4.0

type RunConfig struct {
	*CommonConfig
	Net                  common.NetList // pod should have its own network stack
	LockFd               int            // lock file descriptor
	Interactive          bool           // whether the pod is interactive or not
	MDSRegister          bool           // whether to register with metadata service or not
	Apps                 schema.AppList // applications (prepare gets them via Apps)
	LocalConfig          string         // Path to local configuration
	Hostname             string         // hostname of the pod
	RktGid               int            // group id of the 'rkt' group, -1 ere's no rkt group.
	DNSConfMode          DNSConfMode    // dns configuration file mode - for stAage1
	DNSConfig            cnitypes.DNS   // the DNS configuration (nameservers, search, options)
	InsecureCapabilities bool           // Do not restrict capabilities
	InsecurePaths        bool           // Do not restrict access to files in sysfs or procfs
	InsecureSeccomp      bool           // Do not add seccomp restrictions
	UseOverlay           bool           // run pod with overlay fs
	HostsEntries         HostsEntries   // The entries in /etc/hosts
}

RunConfig defines the configuration parameters needed by Run

type StartConfig added in v1.16.0

type StartConfig struct {
	*CommonConfig
	PodPath     string
	UsesOverlay bool
	AppName     *types.ACName
	PodPID      int
}

type StopConfig added in v1.16.0

type StopConfig struct {
	*CommonConfig
	PodPath string
	AppName *types.ACName
	PodPID  int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL