kubernetesk8s.io/kubernetes/contrib/mesos/pkg/scheduler/resource Index | Files

package resource

import "k8s.io/kubernetes/contrib/mesos/pkg/scheduler/resource"

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
)

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 if and only if 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 if and only if 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

Source Files

doc.go resource.go types.go

Version
v1.1.8
Published
Feb 23, 2016
Platform
js/wasm
Imports
5 packages
Last checked
31 seconds ago

Tools for package owners.