resource

package
v0.18.1-0...-80e799f Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package resource contains the Mesos scheduler specific resource functions

Index

Constants

View Source
const (
	DefaultDefaultContainerCPULimit = CPUShares(0.25) // CPUs allocated for pods without CPU limit
	DefaultDefaultContainerMemLimit = MegaBytes(64.0) // memory allocated for pods without memory limit
)

Variables

This section is empty.

Functions

func LimitPodCPU

func LimitPodCPU(pod *api.Pod, defaultLimit CPUShares) bool

limitPodCPU sets DefaultContainerCPUs for the CPU limit of each container that does not limit its CPU resource yet. limitPodCPU returns true iff at least one container had no CPU limit set.

func LimitPodMem

func LimitPodMem(pod *api.Pod, defaultLimit MegaBytes) bool

limitPodMem sets DefaultContainerMem for the memory limit of each container that does not limit its memory resource yet. limitPodMem returns true iff at least one container had no memory limit set.

Types

type CPUShares

type CPUShares float64

func CPUForPod

func CPUForPod(pod *api.Pod, defaultLimit CPUShares) CPUShares

CPUForPod computes the limits from the spec plus the default CPU limit for unlimited containers

func PodCPULimit

func PodCPULimit(pod *api.Pod) CPUShares

CPUFromPodSpec computes the cpu shares that the pod is admitted to use. Containers without CPU limit are NOT taken into account.

func (*CPUShares) Set

func (f *CPUShares) Set(s string) error

func (*CPUShares) String

func (f *CPUShares) String() string

func (*CPUShares) Type

func (f *CPUShares) Type() string

type MegaBytes

type MegaBytes float64

func MemForPod

func MemForPod(pod *api.Pod, defaultLimit MegaBytes) MegaBytes

MemForPod computes the limits from the spec plus the default memory limit for unlimited containers

func PodMemLimit

func PodMemLimit(pod *api.Pod) MegaBytes

MemFromPodSpec computes the amount of memory that the pod is admitted to use. Containers without memory limit are NOT taken into account.

func (*MegaBytes) Set

func (f *MegaBytes) Set(s string) error

func (*MegaBytes) String

func (f *MegaBytes) String() string

func (*MegaBytes) Type

func (f *MegaBytes) Type() string

Jump to

Keyboard shortcuts

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