cm

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2016 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CgroupConfig added in v1.4.0

type CgroupConfig struct {

	// Fully qualified name
	Name string
	// ResourceParameters contains various cgroups settings to apply.
	ResourceParameters *ResourceConfig
}

CgroupConfig holds the cgroup configuration information. This is common object which is used to specify cgroup information to both systemd and raw cgroup fs implementation of the Cgroup Manager interface.

type CgroupManager added in v1.4.0

type CgroupManager interface {
	// Create creates and applies the cgroup configurations on the cgroup.
	// It just creates the leaf cgroups.
	// It expects the parent cgroup to already exist.
	Create(*CgroupConfig) error
	// Destroys the cgroup.
	Destroy(*CgroupConfig) error
	// Update cgroup configuration.
	Update(*CgroupConfig) error
	// Exists checks if the cgroup already exists
	Exists(string) bool
}

CgroupManager allows for cgroup management. Supports Cgroup Creation ,Deletion and Updates.

func NewCgroupManager added in v1.4.0

func NewCgroupManager(_ interface{}) CgroupManager

type CgroupSubsystems added in v1.4.0

type CgroupSubsystems struct {
	Mounts      []interface{}
	MountPoints map[string]string
}

type ContainerManager

type ContainerManager interface {
	// Runs the container manager's housekeeping.
	// - Ensures that the Docker daemon is in a container.
	// - Creates the system container where all non-containerized processes run.
	Start(*api.Node) error

	// Returns resources allocated to system cgroups in the machine.
	// These cgroups include the system and Kubernetes services.
	SystemCgroupsLimit() api.ResourceList

	// Returns a NodeConfig that is being used by the container manager.
	GetNodeConfig() NodeConfig

	// Returns internal Status.
	Status() Status

	// NewPodContainerManager is a factory method which returns a podContainerManager object
	// Returns a noop implementation if qos cgroup hierarchy is not enabled
	NewPodContainerManager() PodContainerManager

	// GetMountedSubsystems returns the mounted cgroup subsytems on the node
	GetMountedSubsystems() *CgroupSubsystems

	// GetQOSContainersInfo returns the names of top level QoS containers
	GetQOSContainersInfo() QOSContainersInfo
}

Manages the containers running on a machine.

func NewStubContainerManager

func NewStubContainerManager() ContainerManager

type NodeConfig

type NodeConfig struct {
	RuntimeCgroupsName    string
	SystemCgroupsName     string
	KubeletCgroupsName    string
	ContainerRuntime      string
	CgroupsPerQOS         bool
	CgroupRoot            string
	ProtectKernelDefaults bool
}

type PodContainerManager added in v1.4.0

type PodContainerManager interface {
	// getPodContainerName returns the pod container's absolute name
	GetPodContainerName(*api.Pod) string

	// EnsureExists takes a pod as argument and makes sure that
	// pod cgroup exists if qos cgroup hierarchy flag is enabled.
	// If the pod cgroup doesen't already exist this method creates it.
	EnsureExists(*api.Pod) error

	Exists(*api.Pod) bool

	//Destroy takes a pod as argument and destroys the pod's container.
	Destroy(string) error
}

PodContainerManager stores and manages pod level containers The Pod workers interact with the PodContainerManager to create and destroy containers for the pod.

type QOSContainersInfo added in v1.4.0

type QOSContainersInfo struct {
	Guaranteed string
	BestEffort string
	Burstable  string
}

QOSContainersInfo stores the names of containers per qos

type ResourceConfig added in v1.4.0

type ResourceConfig struct {
	// Memory limit (in bytes).
	Memory *int64
	// CPU shares (relative weight vs. other containers).
	CpuShares *int64
	// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
	CpuQuota *int64
}

ResourceConfig holds information about all the supported cgroup resource parameters.

type Status

type Status struct {
	// Any soft requirements that were unsatisfied.
	SoftRequirements error
}

Jump to

Keyboard shortcuts

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