podinfo

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsNoExecutedPod

func ContainsNoExecutedPod(pods []PodContext) bool

func GetFirstPendingPod

func GetFirstPendingPod(pods []PodContext) int

Types

type ActionType

type ActionType string
const (
	ThrottleDown ActionType = "ThrottleDown"
	ThrottleUp   ActionType = "ThrottleUp"
	Evict        ActionType = "Evict"
)

type CPURatio

type CPURatio struct {
	//the min of cpu ratio for pods
	MinCPURatio uint64 `json:"minCPURatio,omitempty"`

	//the step of cpu share and limit for once down-size (1-100)
	StepCPURatio uint64 `json:"stepCPURatio,omitempty"`
}

type ClassAndPriority

type ClassAndPriority struct {
	PodQOSClass        v1.PodQOSClass
	PriorityClassValue int32
}

type ContainerState

type ContainerState struct {
	ContainerName string
	ContainerId   string
	Value         float64
}

func GetPodUsage

func GetPodUsage(metricName string, stateMap map[string][]common.TimeSeries, pod *v1.Pod) (float64, []ContainerState)

func GetUsageById

func GetUsageById(usages []ContainerState, containerId string) (ContainerState, error)

type MemoryThrottleExecutor

type MemoryThrottleExecutor struct {
	// to force gc the page cache of low level pods
	ForceGC bool `json:"forceGC,omitempty"`
}

type PodContext

type PodContext struct {
	Key                        types.NamespacedName
	QOSClass                   v1.PodQOSClass
	Priority                   int32
	StartTime                  *metav1.Time
	DeletionGracePeriodSeconds *int32

	ElasticCPULimit int64
	ElasticMemLimit int64

	PodCPUUsage, PodCPUShare, PodCPUQuota, PodCPUPeriod                             float64
	ContainerCPUUsages, ContainerCPUShares, ContainerCPUQuotas, ContainerCPUPeriods []ContainerState

	PodMemUsage float64

	ActionType  ActionType
	CPUThrottle CPURatio
	Executed    bool
}

func BuildPodActionContext

func BuildPodActionContext(pod *v1.Pod, stateMap map[string][]common.TimeSeries, action *ensuranceapi.AvoidanceAction, actionType ActionType) PodContext

Jump to

Keyboard shortcuts

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