cm

package
v1.4.0-alpha.1....-4fdde68 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// The percent of the machine memory capacity. The value is used to calculate
	// docker memory resource container's hardlimit to workaround docker memory
	// leakage issue. Please see kubernetes/issues/9881 for more detail.
	DockerMemoryLimitThresholdPercent = 70
	// The minimum memory limit allocated to docker container: 150Mi
	MinDockerMemoryLimit = 150 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CgroupConfig

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

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

func NewCgroupManager(cs *cgroupSubsystems) CgroupManager

NewCgroupManager is a factory method that returns a CgroupManager

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() 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
}

Manages the containers running on a machine.

func NewContainerManager

func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.Interface, nodeConfig NodeConfig) (ContainerManager, error)

TODO(vmarmol): Add limits to the system containers. Takes the absolute name of the specified containers. Empty container name disables use of the specified container.

func NewStubContainerManager

func NewStubContainerManager() ContainerManager

type KernelTunableBehavior

type KernelTunableBehavior string

TODO: plumb this up as a flag to Kubelet in a future PR

const (
	KernelTunableWarn   KernelTunableBehavior = "warn"
	KernelTunableError  KernelTunableBehavior = "error"
	KernelTunableModify KernelTunableBehavior = "modify"
)

type NodeConfig

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

type QOSContainersInfo

type QOSContainersInfo struct {
	Guaranteed string
	BestEffort string
	Burstable  string
}

QOSContainersInfo hold the names of containers per qos

func InitQOS

func InitQOS(rootContainer string, subsystems *cgroupSubsystems) (QOSContainersInfo, error)

InitQOS creates the top level qos cgroup containers We create top level QoS containers for only Burstable and Best Effort and not Guaranteed QoS class. All guaranteed pods are nested under the RootContainer by default. InitQOS is called only once during kubelet bootstrapping. TODO(@dubstack) Add support for cgroup-root to work on both systemd and cgroupfs drivers. Currently we only support systems running cgroupfs driver

type ResourceConfig

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