Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultCPUBurstConfig() slov1alpha1.CPUBurstConfig
- func DefaultCPUBurstStrategy() *slov1alpha1.CPUBurstStrategy
- func DefaultCPUQOS(qos apiext.QoSClass) *slov1alpha1.CPUQOS
- func DefaultMemoryQOS(qos apiext.QoSClass) *slov1alpha1.MemoryQOS
- func DefaultNodeSLOSpecConfig() slov1alpha1.NodeSLOSpec
- func DefaultResctrlQOS(qos apiext.QoSClass) *slov1alpha1.ResctrlQOS
- func DefaultResourceQOSStrategy() *slov1alpha1.ResourceQOSStrategy
- func DefaultResourceThresholdStrategy() *slov1alpha1.ResourceThresholdStrategy
- func DumpJSON(o interface{}) string
- func FindContainerIdAndStatusByName(status *corev1.PodStatus, name string) (string, *corev1.ContainerStatus, error)
- func GenerateCPUSetStr(cpuset []int32) string
- func GenerateNodeKey(node *metav1.ObjectMeta) string
- func GeneratePodPatch(oldPod, newPod *corev1.Pod) ([]byte, error)
- func GenerateReservationPatch(oldReservation, newReservation *schedulingv1alpha1.Reservation) ([]byte, error)
- func GetCPUStatUsageTicks() (uint64, error)
- func GetContainerBaseCFSQuota(container *corev1.Container) int64
- func GetContainerBatchMemoryByteLimit(c *corev1.Container) int64
- func GetContainerBatchMemoryByteRequest(c *corev1.Container) int64
- func GetContainerBatchMilliCPULimit(c *corev1.Container) int64
- func GetContainerBatchMilliCPURequest(c *corev1.Container) int64
- func GetContainerCPUUsageNanoseconds(podCgroupDir string, c *corev1.ContainerStatus) (uint64, error)
- func GetContainerCgroupCFSPeriodPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupCFSQuotaPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupCPUAcctUsagePath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupCPUProcsPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupCPUSharePath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupCPUStatPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupMemLimitPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupMemStatPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupPathWithKube(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerCgroupPathWithKubeByID(podParentDir string, containerID string) (string, error)
- func GetContainerCurCFSPeriod(podParentDir string, c *corev1.ContainerStatus) (int64, error)
- func GetContainerCurCFSQuota(podParentDir string, c *corev1.ContainerStatus) (int64, error)
- func GetContainerCurCPUShare(podParentDir string, c *corev1.ContainerStatus) (int64, error)
- func GetContainerCurMemLimitBytes(podParentDir string, c *corev1.ContainerStatus) (int64, error)
- func GetContainerCurTasks(podParentDir string, c *corev1.ContainerStatus) ([]int, error)
- func GetContainerCurTasksPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
- func GetContainerMemStatUsageBytes(podCgroupDir string, c *corev1.ContainerStatus) (int64, error)
- func GetContainerMemoryByteLimit(c *corev1.Container) int64
- func GetContainerMilliCPULimit(c *corev1.Container) int64
- func GetFastLabelSelector(ps *metav1.LabelSelector) (labels.Selector, error)
- func GetKubeQoSByCgroupParent(cgroupDir string) corev1.PodQOSClass
- func GetKubeQosClass(pod *corev1.Pod) corev1.PodQOSClass
- func GetKubeQosRelativePath(qosClass corev1.PodQOSClass) string
- func GetMemInfoUsageKB() (int64, error)
- func GetNodeAddress(node *corev1.Node, addrType corev1.NodeAddressType) (string, error)
- func GetPIDsInContainer(podParentDir string, c *corev1.ContainerStatus) ([]uint32, error)
- func GetPIDsInPod(podParentDir string, cs []corev1.ContainerStatus) ([]uint32, error)
- func GetPodBEMemoryByteLimit(pod *corev1.Pod) int64
- func GetPodBEMemoryByteRequestIgnoreUnlimited(pod *corev1.Pod) int64
- func GetPodBEMilliCPULimit(pod *corev1.Pod) int64
- func GetPodBEMilliCPURequest(pod *corev1.Pod) int64
- func GetPodCPUUsageNanoseconds(podCgroupDir string) (uint64, error)
- func GetPodCgroupCFSPeriodPath(podParentDir string) string
- func GetPodCgroupCFSQuotaPath(podParentDir string) string
- func GetPodCgroupCPUAcctProcUsagePath(podParentDir string) string
- func GetPodCgroupCPUSharePath(podParentDir string) string
- func GetPodCgroupCPUStatPath(podParentDir string) string
- func GetPodCgroupDirWithKube(podKubeRelativeDir string) string
- func GetPodCgroupMemLimitPath(podParentDir string) string
- func GetPodCgroupMemStatPath(podParentDir string) string
- func GetPodCurCFSPeriod(podParentDir string) (int64, error)
- func GetPodCurCFSQuota(podParentDir string) (int64, error)
- func GetPodCurCPUShare(podParentDir string) (int64, error)
- func GetPodCurMemLimitBytes(podParentDir string) (int64, error)
- func GetPodKey(pod *corev1.Pod) string
- func GetPodKubeRelativePath(pod *corev1.Pod) string
- func GetPodMemStatUsageBytes(podCgroupDir string) (int64, error)
- func GetPodMetricKey(podMetric *slov1alpha1.PodMetricInfo) string
- func GetPodMilliCPULimit(pod *corev1.Pod) int64
- func GetPodQoSRelativePath(qosClass corev1.PodQOSClass) string
- func GetPodRequest(pod *corev1.Pod, resourceNames ...corev1.ResourceName) corev1.ResourceList
- func GetReservationKey(r *schedulingv1alpha1.Reservation) string
- func GetReservationNameFromReservePod(pod *corev1.Pod) string
- func GetReservationNodeName(r *schedulingv1alpha1.Reservation) string
- func GetReservationSchedulerName(r *schedulingv1alpha1.Reservation) string
- func GetReservePodKey(pod *corev1.Pod) string
- func GetReservePodNodeName(pod *corev1.Pod) string
- func GetRootCgroupCPUSetDir(qosClass corev1.PodQOSClass) string
- func GetRootCgroupCPUUsageNanoseconds(qosClass corev1.PodQOSClass) (uint64, error)
- func GetRootCgroupCurCFSPeriod(qosClass corev1.PodQOSClass) (int64, error)
- func GetRootCgroupCurCFSQuota(qosClass corev1.PodQOSClass) (int64, error)
- func GetRootCgroupCurCPUSet(qosClass corev1.PodQOSClass) ([]int32, error)
- func IsNodeAddressTypeSupported(addrType corev1.NodeAddressType) bool
- func IsObjValidActiveReservation(obj interface{}) bool
- func IsPodTerminated(pod *corev1.Pod) bool
- func IsReservationActive(r *schedulingv1alpha1.Reservation) bool
- func IsReservationAvailable(r *schedulingv1alpha1.Reservation) bool
- func IsReservationExpired(r *schedulingv1alpha1.Reservation) bool
- func IsReservationFailed(r *schedulingv1alpha1.Reservation) bool
- func IsReservationSucceeded(r *schedulingv1alpha1.Reservation) bool
- func IsReservePod(pod *corev1.Pod) bool
- func IsResourceDiff(old, new corev1.ResourceList, resourceName corev1.ResourceName, ...) bool
- func MaxInt64(i, j int64) int64
- func MergeCPUSet(old, new []int32) []int32
- func MergeCfg(old, new interface{}) (interface{}, error)
- func MinInt64(i, j int64) int64
- func MultiplyMilliQuant(quant resource.Quantity, factor float64) resource.Quantity
- func MultiplyQuant(quant resource.Quantity, factor float64) resource.Quantity
- func NewReservePod(r *schedulingv1alpha1.Reservation) *corev1.Pod
- func NewZeroResourceList() corev1.ResourceList
- func NoneCPUQOS() *slov1alpha1.CPUQOS
- func NoneMemoryQOS() *slov1alpha1.MemoryQOS
- func NoneResctrlQOS() *slov1alpha1.ResctrlQOS
- func NoneResourceQOS(qos apiext.QoSClass) *slov1alpha1.ResourceQOS
- func NoneResourceQOSStrategy() *slov1alpha1.ResourceQOSStrategy
- func ParseCPUSetStr(cpusetStr string) ([]int32, error)
- func ParseContainerID(basename string) (string, error)
- func ParseContainerId(data string) (cType, cID string, err error)
- func ParsePodID(basename string) (string, error)
- func PatchPod(clientset clientset.Interface, oldPod, newPod *corev1.Pod) (*corev1.Pod, error)
- func PatchReservation(clientset koordinatorclientset.Interface, ...) (*schedulingv1alpha1.Reservation, error)
- func RetryOnConflictOrTooManyRequests(fn func() error) error
- func RunFeature(moduleFunc func(), featureDependency []featuregate.Feature, interval int, ...) bool
- func RunFeatureWithInit(moduleInit func() error, moduleFunc func(), ...) bool
- func SetReservationNodeName(r *schedulingv1alpha1.Reservation, nodeName string)
- func SetReservationUnschedulable(r *schedulingv1alpha1.Reservation, msg string)
- func ValidateReservation(r *schedulingv1alpha1.Reservation) error
- func WriteCgroupCPUSet(cgroupFileDir, cpusetStr string) error
- type CPUBasicInfo
- type CPUTotalInfo
- type LocalCPUInfo
- type MemInfo
- type Patch
- func (p *Patch) AddAnnotations(annotations map[string]string) *Patch
- func (p *Patch) AddLabels(labels map[string]string) *Patch
- func (p *Patch) PatchPod(pod *corev1.Pod) (*corev1.Pod, error)
- func (p *Patch) PatchPodOrReservation(pod *corev1.Pod) (interface{}, error)
- func (p *Patch) PatchReservation(r *schedulingv1alpha1.Reservation) (*schedulingv1alpha1.Reservation, error)
- func (p *Patch) RemoveAnnotations(annotationKeys []string) *Patch
- func (p *Patch) RemoveLabels(labelKeys []string) *Patch
- func (p *Patch) WithClientset(cs clientset.Interface) *Patch
- func (p *Patch) WithHandle(handle framework.Handle) *Patch
- func (p *Patch) WithKoordinatorClientSet(cs koordinatorclientset.Interface) *Patch
- type ProcessorInfo
- type ReservationToPodEventHandlerFuncs
Constants ¶
const (
ProcMemInfoPath = "/proc/meminfo"
)
Variables ¶
var ( // AnnotationReservePod indicates whether the pod is a reserved pod. AnnotationReservePod = apiext.SchedulingDomainPrefix + "/reserve-pod" // AnnotationReservationName indicates the name of the reservation. AnnotationReservationName = apiext.SchedulingDomainPrefix + "/reservation-name" // AnnotationReservationNode indicates the node name if the reservation specifies a node. AnnotationReservationNode = apiext.SchedulingDomainPrefix + "/reservation-node" )
var (
CpuacctUsageTypeStat = sets.NewString("user", "nice", "system", "irq", "softirq")
)
Functions ¶
func DefaultCPUBurstConfig ¶ added in v0.3.0
func DefaultCPUBurstConfig() slov1alpha1.CPUBurstConfig
func DefaultCPUBurstStrategy ¶ added in v0.3.0
func DefaultCPUBurstStrategy() *slov1alpha1.CPUBurstStrategy
func DefaultCPUQOS ¶ added in v0.6.0
func DefaultCPUQOS(qos apiext.QoSClass) *slov1alpha1.CPUQOS
func DefaultMemoryQOS ¶ added in v0.6.0
func DefaultMemoryQOS(qos apiext.QoSClass) *slov1alpha1.MemoryQOS
DefaultMemoryQOS returns the recommended configuration for memory qos strategy. Please refer to `apis/slo/v1alpha1` for the definition of each field. In the recommended configuration, all abilities of memcg qos are disable, including `MinLimitPercent`, `LowLimitPercent`, `ThrottlingPercent` since they are not fully beneficial to all scenarios. Whereas, they are still useful when the use case is determined. e.g. lock some memory to improve file read performance. Asynchronous memory reclaim is enabled by default to alleviate the direct reclaim pressure, including `WmarkRatio` and `WmarkScalePermill`. The watermark of async reclaim is not recommended to set too low, since lower the watermark the more excess reclamations. Memory min watermark grading corresponding to `WmarkMinAdj` is enabled. It benefits high-priority pods by postponing global reclaim when machine's free memory is below than `/proc/sys/vm/min_free_kbytes`.
func DefaultNodeSLOSpecConfig ¶
func DefaultNodeSLOSpecConfig() slov1alpha1.NodeSLOSpec
DefaultNodeSLOSpecConfig defines the default config of the nodeSLOSpec, which would be used by the resmgr
func DefaultResctrlQOS ¶ added in v0.6.0
func DefaultResctrlQOS(qos apiext.QoSClass) *slov1alpha1.ResctrlQOS
TODO https://github.com/koordinator-sh/koordinator/pull/94#discussion_r858786733
func DefaultResourceQOSStrategy ¶ added in v0.6.0
func DefaultResourceQOSStrategy() *slov1alpha1.ResourceQOSStrategy
func DefaultResourceThresholdStrategy ¶
func DefaultResourceThresholdStrategy() *slov1alpha1.ResourceThresholdStrategy
func FindContainerIdAndStatusByName ¶ added in v0.2.0
func GenerateCPUSetStr ¶ added in v0.2.0
GenerateCPUSetStr generates the cpuset string from the cpuset slice eg. [3,2,1,0] => "3,2,1,0"
func GenerateNodeKey ¶ added in v0.7.0
func GenerateNodeKey(node *metav1.ObjectMeta) string
GenerateNodeKey returns a generated key with given meta
func GeneratePodPatch ¶ added in v0.7.0
func GenerateReservationPatch ¶ added in v0.7.0
func GenerateReservationPatch(oldReservation, newReservation *schedulingv1alpha1.Reservation) ([]byte, error)
func GetCPUStatUsageTicks ¶ added in v0.2.0
GetCPUStatUsageTicks returns the node's CPU usage ticks
func GetContainerBaseCFSQuota ¶ added in v0.3.0
func GetContainerBatchMemoryByteLimit ¶ added in v0.7.0
func GetContainerBatchMemoryByteRequest ¶ added in v0.7.0
func GetContainerBatchMilliCPULimit ¶ added in v0.7.0
func GetContainerBatchMilliCPURequest ¶ added in v0.7.0
func GetContainerCPUUsageNanoseconds ¶ added in v0.5.0
func GetContainerCPUUsageNanoseconds(podCgroupDir string, c *corev1.ContainerStatus) (uint64, error)
func GetContainerCgroupCFSPeriodPath ¶ added in v0.2.0
func GetContainerCgroupCFSPeriodPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupCFSQuotaPath ¶ added in v0.2.0
func GetContainerCgroupCFSQuotaPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupCPUAcctUsagePath ¶ added in v0.5.0
func GetContainerCgroupCPUAcctUsagePath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupCPUProcsPath ¶ added in v0.6.0
func GetContainerCgroupCPUProcsPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
@parentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @return /sys/fs/cgroup/cpu/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/cgroup.procs
func GetContainerCgroupCPUSharePath ¶ added in v0.2.0
func GetContainerCgroupCPUSharePath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupCPUStatPath ¶ added in v0.2.0
func GetContainerCgroupCPUStatPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupMemLimitPath ¶ added in v0.2.0
func GetContainerCgroupMemLimitPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupMemStatPath ¶ added in v0.2.0
func GetContainerCgroupMemStatPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerCgroupPathWithKube ¶ added in v0.2.0
func GetContainerCgroupPathWithKube(podParentDir string, c *corev1.ContainerStatus) (string, error)
@parentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @return kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/****.scope
func GetContainerCgroupPathWithKubeByID ¶ added in v0.5.0
@parentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @return kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/****.scope
func GetContainerCurCFSPeriod ¶ added in v0.2.0
func GetContainerCurCFSPeriod(podParentDir string, c *corev1.ContainerStatus) (int64, error)
func GetContainerCurCFSQuota ¶ added in v0.2.0
func GetContainerCurCFSQuota(podParentDir string, c *corev1.ContainerStatus) (int64, error)
func GetContainerCurCPUShare ¶ added in v0.2.0
func GetContainerCurCPUShare(podParentDir string, c *corev1.ContainerStatus) (int64, error)
func GetContainerCurMemLimitBytes ¶ added in v0.2.0
func GetContainerCurMemLimitBytes(podParentDir string, c *corev1.ContainerStatus) (int64, error)
func GetContainerCurTasks ¶ added in v0.3.0
func GetContainerCurTasks(podParentDir string, c *corev1.ContainerStatus) ([]int, error)
func GetContainerCurTasksPath ¶ added in v0.3.0
func GetContainerCurTasksPath(podParentDir string, c *corev1.ContainerStatus) (string, error)
func GetContainerMemStatUsageBytes ¶ added in v0.2.0
func GetContainerMemStatUsageBytes(podCgroupDir string, c *corev1.ContainerStatus) (int64, error)
func GetContainerMemoryByteLimit ¶ added in v0.3.0
func GetContainerMilliCPULimit ¶ added in v0.3.0
func GetFastLabelSelector ¶
func GetFastLabelSelector(ps *metav1.LabelSelector) (labels.Selector, error)
func GetKubeQoSByCgroupParent ¶ added in v0.4.0
func GetKubeQoSByCgroupParent(cgroupDir string) corev1.PodQOSClass
func GetKubeQosClass ¶ added in v0.2.0
func GetKubeQosClass(pod *corev1.Pod) corev1.PodQOSClass
func GetKubeQosRelativePath ¶ added in v0.2.0
func GetKubeQosRelativePath(qosClass corev1.PodQOSClass) string
@output like kubepods.slice/kubepods-besteffort.slice/
func GetMemInfoUsageKB ¶ added in v0.2.0
GetMemInfoUsageKB returns the node's memory usage quantity (kB)
func GetNodeAddress ¶ added in v0.4.1
GetNodeAddress get node specified type address.
func GetPIDsInContainer ¶ added in v0.6.0
func GetPIDsInContainer(podParentDir string, c *corev1.ContainerStatus) ([]uint32, error)
func GetPIDsInPod ¶ added in v0.6.0
func GetPIDsInPod(podParentDir string, cs []corev1.ContainerStatus) ([]uint32, error)
func GetPodBEMemoryByteLimit ¶ added in v0.2.0
func GetPodBEMemoryByteRequestIgnoreUnlimited ¶ added in v0.3.0
func GetPodBEMilliCPULimit ¶ added in v0.2.0
func GetPodBEMilliCPURequest ¶ added in v0.2.0
func GetPodCPUUsageNanoseconds ¶ added in v0.5.0
GetPodCPUUsage returns the pod's CPU usage in nanosecond
func GetPodCgroupCFSPeriodPath ¶ added in v0.2.0
func GetPodCgroupCFSQuotaPath ¶ added in v0.2.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/cpu/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/cpu.cfs_quota_us
func GetPodCgroupCPUAcctProcUsagePath ¶ added in v0.5.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/cpuacct/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/cpuacct.usage
func GetPodCgroupCPUSharePath ¶ added in v0.2.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/cpu/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/cpu.shares
func GetPodCgroupCPUStatPath ¶ added in v0.2.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/cpu/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/cpu.stat
func GetPodCgroupDirWithKube ¶ added in v0.2.0
@kubeRelativeDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @return kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/
func GetPodCgroupMemLimitPath ¶ added in v0.2.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/memory/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/memory.limit_in_bytes
func GetPodCgroupMemStatPath ¶ added in v0.2.0
@podParentDir kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/ @output /sys/fs/cgroup/memory/kubepods.slice/kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/memory.stat
func GetPodCurCFSPeriod ¶ added in v0.2.0
func GetPodCurCFSQuota ¶ added in v0.2.0
func GetPodCurCPUShare ¶ added in v0.2.0
func GetPodCurMemLimitBytes ¶ added in v0.2.0
func GetPodKubeRelativePath ¶ added in v0.2.0
@return like kubepods-burstable.slice/kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice/
func GetPodMemStatUsageBytes ¶ added in v0.2.0
GetPodMemStatUsageBytes returns the pod's memory usage quantity (Byte)
func GetPodMetricKey ¶
func GetPodMetricKey(podMetric *slov1alpha1.PodMetricInfo) string
func GetPodMilliCPULimit ¶ added in v0.7.0
func GetPodQoSRelativePath ¶ added in v0.2.0
func GetPodQoSRelativePath(qosClass corev1.PodQOSClass) string
@return like kubepods.slice/kubepods-burstable.slice/
func GetPodRequest ¶
func GetPodRequest(pod *corev1.Pod, resourceNames ...corev1.ResourceName) corev1.ResourceList
func GetReservationKey ¶ added in v0.7.0
func GetReservationKey(r *schedulingv1alpha1.Reservation) string
func GetReservationNameFromReservePod ¶ added in v0.7.0
func GetReservationNodeName ¶ added in v0.7.0
func GetReservationNodeName(r *schedulingv1alpha1.Reservation) string
func GetReservationSchedulerName ¶ added in v0.7.0
func GetReservationSchedulerName(r *schedulingv1alpha1.Reservation) string
func GetReservePodKey ¶ added in v0.7.0
func GetReservePodNodeName ¶ added in v0.7.0
func GetRootCgroupCPUSetDir ¶ added in v0.2.0
func GetRootCgroupCPUSetDir(qosClass corev1.PodQOSClass) string
GetRootCgroupCPUSetDir gets the cpuset parent directory of the specified podQos' root cgroup @output /sys/fs/cgroup/cpuset/kubepods.slice/kubepods-besteffort.slice
func GetRootCgroupCPUUsageNanoseconds ¶ added in v0.5.0
func GetRootCgroupCPUUsageNanoseconds(qosClass corev1.PodQOSClass) (uint64, error)
func GetRootCgroupCurCFSPeriod ¶ added in v0.4.0
func GetRootCgroupCurCFSPeriod(qosClass corev1.PodQOSClass) (int64, error)
func GetRootCgroupCurCFSQuota ¶ added in v0.4.0
func GetRootCgroupCurCFSQuota(qosClass corev1.PodQOSClass) (int64, error)
func GetRootCgroupCurCPUSet ¶ added in v0.2.0
func GetRootCgroupCurCPUSet(qosClass corev1.PodQOSClass) ([]int32, error)
GetRootCgroupCurCPUSet gets the current cpuset of the specified podQos' root cgroup
func IsNodeAddressTypeSupported ¶ added in v0.4.1
func IsNodeAddressTypeSupported(addrType corev1.NodeAddressType) bool
IsNodeAddressTypeSupported determine whether addrType is a supported type.
func IsObjValidActiveReservation ¶ added in v0.7.0
func IsObjValidActiveReservation(obj interface{}) bool
func IsPodTerminated ¶ added in v0.4.0
func IsReservationActive ¶ added in v0.7.0
func IsReservationActive(r *schedulingv1alpha1.Reservation) bool
IsReservationActive checks if the reservation is scheduled and its status is Available/Waiting (active to use).
func IsReservationAvailable ¶ added in v0.7.0
func IsReservationAvailable(r *schedulingv1alpha1.Reservation) bool
IsReservationAvailable checks if the reservation is scheduled on a node and its status is Available.
func IsReservationExpired ¶ added in v0.7.0
func IsReservationExpired(r *schedulingv1alpha1.Reservation) bool
func IsReservationFailed ¶ added in v0.7.0
func IsReservationFailed(r *schedulingv1alpha1.Reservation) bool
func IsReservationSucceeded ¶ added in v0.7.0
func IsReservationSucceeded(r *schedulingv1alpha1.Reservation) bool
func IsReservePod ¶ added in v0.7.0
func IsResourceDiff ¶
func IsResourceDiff(old, new corev1.ResourceList, resourceName corev1.ResourceName, diffThreshold float64) bool
IsResourceDiff returns whether the new resource has big enough difference with the old one or not
func MergeCPUSet ¶ added in v0.2.0
MergeCPUSet merges the old cpuset with the new one, and also deduplicate and keeps a desc order by processor ids e.g. [1,0], [3,2,2,1] => [3,2,1,0]
func MergeCfg ¶ added in v0.2.0
func MergeCfg(old, new interface{}) (interface{}, error)
MergeCfg returns a merged interface. Value in new will override old's when both fields exist. It will throw an error if:
- either of the inputs was nil;
- inputs were not a pointer of the same json struct.
func MultiplyMilliQuant ¶
MultiplyMilliQuant scales quantity by factor
func MultiplyQuant ¶
MultiplyQuant scales quantity by factor
func NewReservePod ¶ added in v0.7.0
func NewReservePod(r *schedulingv1alpha1.Reservation) *corev1.Pod
NewReservePod returns a fake pod set as the reservation's specifications. The reserve pod is only visible for the scheduler and does not make actual creation on nodes.
func NewZeroResourceList ¶
func NewZeroResourceList() corev1.ResourceList
func NoneCPUQOS ¶ added in v0.6.0
func NoneCPUQOS() *slov1alpha1.CPUQOS
func NoneMemoryQOS ¶ added in v0.6.0
func NoneMemoryQOS() *slov1alpha1.MemoryQOS
NoneMemoryQOS returns the all-disabled configuration for memory qos strategy.
func NoneResctrlQOS ¶ added in v0.6.0
func NoneResctrlQOS() *slov1alpha1.ResctrlQOS
func NoneResourceQOS ¶ added in v0.6.0
func NoneResourceQOS(qos apiext.QoSClass) *slov1alpha1.ResourceQOS
func NoneResourceQOSStrategy ¶ added in v0.6.0
func NoneResourceQOSStrategy() *slov1alpha1.ResourceQOSStrategy
NoneResourceQOSStrategy indicates the qos strategy with all qos
func ParseCPUSetStr ¶ added in v0.2.0
ParseCPUSetStr parses cpuset string into a slice eg. "0-5,34,46-48" => [0,1,2,3,4,5,34,46,47,48]
func ParseContainerID ¶ added in v0.2.0
@return 7712555c_ce62_454a_9e18_9ff0217b8941 from docker-7712555c_ce62_454a_9e18_9ff0217b8941.scope
func ParseContainerId ¶ added in v0.2.0
func ParsePodID ¶ added in v0.2.0
@return 7712555c_ce62_454a_9e18_9ff0217b8941 from kubepods-pod7712555c_ce62_454a_9e18_9ff0217b8941.slice
func PatchReservation ¶ added in v0.7.0
func PatchReservation(clientset koordinatorclientset.Interface, oldReservation, newReservation *schedulingv1alpha1.Reservation) (*schedulingv1alpha1.Reservation, error)
func RetryOnConflictOrTooManyRequests ¶ added in v0.7.0
func RunFeature ¶ added in v0.2.0
func RunFeature(moduleFunc func(), featureDependency []featuregate.Feature, interval int, stopCh <-chan struct{}) bool
RunFeature runs moduleFunc only if interval > 0 AND at least one feature dependency is enabled
func RunFeatureWithInit ¶ added in v0.2.0
func RunFeatureWithInit(moduleInit func() error, moduleFunc func(), featureDependency []featuregate.Feature, interval int, stopCh <-chan struct{}) bool
RunFeatureWithInit runs moduleFunc only if interval > 0 , at least one feature dependency is enabled and moduleInit function returns nil
func SetReservationNodeName ¶ added in v0.7.0
func SetReservationNodeName(r *schedulingv1alpha1.Reservation, nodeName string)
func SetReservationUnschedulable ¶ added in v0.7.0
func SetReservationUnschedulable(r *schedulingv1alpha1.Reservation, msg string)
func ValidateReservation ¶ added in v0.7.0
func ValidateReservation(r *schedulingv1alpha1.Reservation) error
func WriteCgroupCPUSet ¶ added in v0.2.0
WriteCgroupCPUSet writes the cgroup cpuset file according to the specified cgroup dir
Types ¶
type CPUBasicInfo ¶ added in v0.2.0
type CPUBasicInfo struct { HyperThreadEnabled bool `json:"hyperThreadEnabled,omitempty"` CatL3CbmMask string `json:"catL3CbmMask,omitempty"` }
CPUBasicInfo describes the cpu basic features and status
type CPUTotalInfo ¶ added in v0.2.0
type CPUTotalInfo struct { NumberCPUs int32 `json:"numberCPUs"` NumberCores int32 `json:"numberCores"` NumberSockets int32 `json:"numberSockets"` NumberNodes int32 `json:"numberNodes"` NumberL3s int32 `json:"numberL3s"` }
CPUTotalInfo describes the total number infos of the local cpu, e.g. the number of cores, the number of numa nodes
type LocalCPUInfo ¶ added in v0.2.0
type LocalCPUInfo struct { // BasicInfo describe the cpu features and their status BasicInfo CPUBasicInfo `json:"basicInfo,omitempty"` // ProcessorInfos contains topology information of all available CPUs ProcessorInfos []ProcessorInfo `json:"processorInfos,omitempty"` // TotalInfo stores the numbers of cpu processors, cores, sockets and nodes TotalInfo CPUTotalInfo `json:"totalInfo,omitempty"` }
LocalCPUInfo contains the cpu information collected from the node
func GetLocalCPUInfo ¶ added in v0.2.0
func GetLocalCPUInfo() (*LocalCPUInfo, error)
GetLocalCPUInfo returns the local cpu info for cpuset allocation, NUMA-aware scheduling
type MemInfo ¶ added in v0.2.0
type MemInfo struct { MemTotal uint64 `json:"mem_total"` MemFree uint64 `json:"mem_free"` MemAvailable uint64 `json:"mem_available"` Buffers uint64 `json:"buffers"` Cached uint64 `json:"cached"` SwapCached uint64 `json:"swap_cached"` Active uint64 `json:"active"` Inactive uint64 `json:"inactive"` ActiveAnon uint64 `json:"active_anon" field:"Active(anon)"` InactiveAnon uint64 `json:"inactive_anon" field:"Inactive(anon)"` ActiveFile uint64 `json:"active_file" field:"Active(file)"` InactiveFile uint64 `json:"inactive_file" field:"Inactive(file)"` Unevictable uint64 `json:"unevictable"` Mlocked uint64 `json:"mlocked"` SwapTotal uint64 `json:"swap_total"` SwapFree uint64 `json:"swap_free"` Dirty uint64 `json:"dirty"` Writeback uint64 `json:"write_back"` AnonPages uint64 `json:"anon_pages"` Mapped uint64 `json:"mapped"` Shmem uint64 `json:"shmem"` Slab uint64 `json:"slab"` SReclaimable uint64 `json:"s_reclaimable"` SUnreclaim uint64 `json:"s_unclaim"` KernelStack uint64 `json:"kernel_stack"` PageTables uint64 `json:"page_tables"` NFS_Unstable uint64 `json:"nfs_unstable"` Bounce uint64 `json:"bounce"` WritebackTmp uint64 `json:"writeback_tmp"` CommitLimit uint64 `json:"commit_limit"` Committed_AS uint64 `json:"committed_as"` VmallocTotal uint64 `json:"vmalloc_total"` VmallocUsed uint64 `json:"vmalloc_used"` VmallocChunk uint64 `json:"vmalloc_chunk"` HardwareCorrupted uint64 `json:"hardware_corrupted"` AnonHugePages uint64 `json:"anon_huge_pages"` HugePages_Total uint64 `json:"huge_pages_total"` HugePages_Free uint64 `json:"huge_pages_free"` HugePages_Rsvd uint64 `json:"huge_pages_rsvd"` HugePages_Surp uint64 `json:"huge_pages_surp"` Hugepagesize uint64 `json:"hugepagesize"` DirectMap4k uint64 `json:"direct_map_4k"` DirectMap2M uint64 `json:"direct_map_2M"` DirectMap1G uint64 `json:"direct_map_1G"` }
type Patch ¶ added in v0.7.0
type Patch struct { Clientset clientset.Interface KoordClientset koordinatorclientset.Interface // patch data // NOTE: add more fields if needed LabelsAdd map[string]string AnnotationsAdd map[string]string LabelsRemove []string AnnotationsRemove []string }
Patch is for simply patching arbitrary objects (e.g. pods, koord CRDs).
func (*Patch) AddAnnotations ¶ added in v0.7.0
func (*Patch) PatchPodOrReservation ¶ added in v0.7.0
PatchPodOrReservation patches the pod (if the pod is not a reserve pod) or corresponding reservation object (if the pod is a reserve pod) with the given patch data.
func (*Patch) PatchReservation ¶ added in v0.7.0
func (p *Patch) PatchReservation(r *schedulingv1alpha1.Reservation) (*schedulingv1alpha1.Reservation, error)
func (*Patch) RemoveAnnotations ¶ added in v0.7.0
func (*Patch) RemoveLabels ¶ added in v0.7.0
func (*Patch) WithClientset ¶ added in v0.7.0
func (*Patch) WithHandle ¶ added in v0.7.0
func (*Patch) WithKoordinatorClientSet ¶ added in v0.7.0
func (p *Patch) WithKoordinatorClientSet(cs koordinatorclientset.Interface) *Patch
type ProcessorInfo ¶ added in v0.2.0
type ProcessorInfo struct { // logic CPU/ processor ID CPUID int32 `json:"cpu"` // physical CPU core ID CoreID int32 `json:"core"` // cpu socket ID SocketID int32 `json:"socket"` // numa node ID NodeID int32 `json:"node"` // L1 L2 cache ID L1dl1il2 string `json:"l1dl1il2"` // L3 cache ID L3 int32 `json:"l3"` // online Online string `json:"online"` }
ProcessorInfo describes the processor topology information of a single logic cpu, including the core, socket and numa node it belongs to
type ReservationToPodEventHandlerFuncs ¶ added in v0.7.0
type ReservationToPodEventHandlerFuncs struct { FilterFunc func(obj interface{}) bool PodHandler cache.ResourceEventHandler }
ReservationToPodEventHandlerFuncs can be used to handle reservation events with a pod event handler, which converts each reservation object into the corresponding reserve pod object.
e.g. func registerReservationEventHandler(handle framework.Handle, podHandler podHandler) { extendedHandle, ok := handle.(frameworkext.ExtendedHandle) if !ok { // if not implement extendedHandle, ignore reservation events klog.V(3).Infof("registerReservationEventHandler aborted, cannot convert handle to frameworkext.ExtendedHandle, got %T", handle) return } extendedHandle.KoordinatorSharedInformerFactory().Scheduling().V1alpha1().Reservations().Informer().AddEventHandler(&util.ReservationToPodEventHandlerFuncs{ FilterFunc: util.IsObjValidActiveReservation, PodHandler: &podHandler, }) }
func (ReservationToPodEventHandlerFuncs) OnAdd ¶ added in v0.7.0
func (r ReservationToPodEventHandlerFuncs) OnAdd(obj interface{})
func (ReservationToPodEventHandlerFuncs) OnDelete ¶ added in v0.7.0
func (r ReservationToPodEventHandlerFuncs) OnDelete(obj interface{})
OnDelete calls DeleteFunc if it's not nil.
func (ReservationToPodEventHandlerFuncs) OnUpdate ¶ added in v0.7.0
func (r ReservationToPodEventHandlerFuncs) OnUpdate(oldObj, newObj interface{})
OnUpdate calls UpdateFunc if it's not nil.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
metrics
|
|
handler/mockclient
Package mock_client is a generated GoMock package.
|
Package mock_client is a generated GoMock package. |