Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PodEvicionAdmission ¶
type PodEvicionAdmission interface { // LoopInit initializes PodEvicionAdmission for next Updater loop LoopInit() // Admit returns true if PodEvicionAdmission decides that pod can be evicted with given recommendation. Admit(pod *apiv1.Pod, recommendation *vpa_types.RecommendedPodResources) bool }
PodEvicionAdmission controls evictions of pods.
func NewDefaultPodEvicionAdmission ¶
func NewDefaultPodEvicionAdmission() PodEvicionAdmission
NewDefaultPodEvicionAdmission constructs new PodEvicionAdmission that admits all pods.
type UpdateConfig ¶
type UpdateConfig struct { // MinChangePriority is the minimum change priority that will trigger a update. // TODO: should have separate for Mem and CPU? MinChangePriority float64 }
UpdateConfig holds configuration for UpdatePriorityCalculator
type UpdatePriorityCalculator ¶
type UpdatePriorityCalculator struct {
// contains filtered or unexported fields
}
UpdatePriorityCalculator is responsible for prioritizing updates on pods. It can returns a sorted list of pods in order of update priority. Update priority is proportional to fraction by which resources should be increased / decreased. i.e. pod with 10M current memory and recommendation 20M will have higher update priority than pod with 100M current memory and 150M recommendation (100% increase vs 50% increase)
func NewUpdatePriorityCalculator ¶
func NewUpdatePriorityCalculator(policy *vpa_types.PodResourcePolicy, config *UpdateConfig, processor vpa_api_util.RecommendationProcessor) UpdatePriorityCalculator
NewUpdatePriorityCalculator creates new UpdatePriorityCalculator for the given resources policy and configuration. If the given policy is nil, there will be no policy restriction on update. If the given config is nil, default values are used.
func (*UpdatePriorityCalculator) AddPod ¶
func (calc *UpdatePriorityCalculator) AddPod(pod *apiv1.Pod, recommendation *vpa_types.RecommendedPodResources, now time.Time)
AddPod adds pod to the UpdatePriorityCalculator.
func (*UpdatePriorityCalculator) GetSortedPods ¶
func (calc *UpdatePriorityCalculator) GetSortedPods(admission PodEvicionAdmission) []*apiv1.Pod
GetSortedPods returns a list of pods ordered by update priority (highest update priority first)