Documentation ¶
Overview ¶
Package resource contains the Mesos scheduler specific resource functions
Index ¶
Constants ¶
const ( DefaultDefaultContainerCPULimit = CPUShares(0.25) // CPUs allocated for pods without CPU limit DefaultDefaultContainerMemLimit = MegaBytes(64.0) // memory allocated for pods without memory limit MinimumContainerCPU = CPUShares(0.01) // minimum CPUs allowed by Mesos MinimumContainerMem = MegaBytes(32.0) // minimum memory allowed by Mesos )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUShares ¶
type CPUShares float64
func LimitPodCPU ¶
func LimitPodCPU(pod *api.Pod, defaultLimit CPUShares) (request, limit CPUShares, modified bool, err error)
LimitPodCPU sets default CPU requests and limits of each container that does not limit its CPU resource yet. LimitPodCPU returns the new request, limit and whether the pod was modified.
func LimitedCPUForPod ¶
func LimitedCPUForPod(pod *api.Pod, defaultLimit CPUShares) (request, limit CPUShares, modified bool, err error)
LimitedCPUForPod computes the limits from the spec plus the default CPU limit difference for unlimited containers
func NewCPUShares ¶
type MegaBytes ¶
type MegaBytes float64
func LimitPodMem ¶
func LimitPodMem(pod *api.Pod, defaultLimit MegaBytes) (request, limit MegaBytes, modified bool, err error)
LimitPodMem sets default memory requests and limits of each container that does not limit its memory resource yet. LimitPodMem returns the new request, limit and whether the pod was modified.
func LimitedMemForPod ¶
func LimitedMemForPod(pod *api.Pod, defaultLimit MegaBytes) (request, limit MegaBytes, modified bool, err error)
LimitedMemForPod computes the limits from the spec plus the default memory limit difference for unlimited containers