Documentation ¶
Index ¶
- func CreateOrUpdateMpaCheckpoint(mpaCheckpointClient vpa_api.VerticalPodAutoscalerCheckpointInterface, ...) error
- func GetUpdateMode(mpa *mpa_types.MultidimPodAutoscaler) vpa_types.UpdateMode
- func NewMpasLister(mpaClient *mpa_clientset.Clientset, stopChannel <-chan struct{}, ...) mpa_lister.MultidimPodAutoscalerLister
- func PodLabelsMatchMPA(podNamespace string, labels labels.Set, mpaNamespace string, ...) bool
- func PodMatchesMPA(pod *core.Pod, mpaWithSelector *MpaWithSelector) bool
- func UpdateMpaStatusIfNeeded(mpaClient mpa_api.MultidimPodAutoscalerInterface, mpaName string, ...) (result *mpa_types.MultidimPodAutoscaler, err error)
- type ContainerToAnnotationsMap
- type MpaWithSelector
- type RecommendationProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateMpaCheckpoint ¶
func CreateOrUpdateMpaCheckpoint(mpaCheckpointClient vpa_api.VerticalPodAutoscalerCheckpointInterface, mpaCheckpoint *vpa_types.VerticalPodAutoscalerCheckpoint) error
CreateOrUpdateMpaCheckpoint updates the status field of the MPA Checkpoint API object. If object doesn't exits it is created.
func GetUpdateMode ¶ added in v0.3.0
func GetUpdateMode(mpa *mpa_types.MultidimPodAutoscaler) vpa_types.UpdateMode
GetUpdateMode returns the updatePolicy.updateMode for a given MPA. If the mode is not specified it returns the default (UpdateModeAuto).
func NewMpasLister ¶
func NewMpasLister(mpaClient *mpa_clientset.Clientset, stopChannel <-chan struct{}, namespace string) mpa_lister.MultidimPodAutoscalerLister
NewMpasLister returns MultidimPodAutoscalerLister configured to fetch all MPA objects from namespace, set namespace to k8sapiv1.NamespaceAll to select all namespaces. The method blocks until mpaLister is initially populated.
func PodLabelsMatchMPA ¶ added in v0.3.0
func PodLabelsMatchMPA(podNamespace string, labels labels.Set, mpaNamespace string, mpaSelector labels.Selector) bool
PodLabelsMatchMPA returns true iff the mpaWithSelector matches the pod labels.
func PodMatchesMPA ¶ added in v0.3.0
func PodMatchesMPA(pod *core.Pod, mpaWithSelector *MpaWithSelector) bool
PodMatchesMPA returns true iff the mpaWithSelector matches the Pod.
func UpdateMpaStatusIfNeeded ¶
func UpdateMpaStatusIfNeeded(mpaClient mpa_api.MultidimPodAutoscalerInterface, mpaName string, newStatus, oldStatus *mpa_types.MultidimPodAutoscalerStatus) (result *mpa_types.MultidimPodAutoscaler, err error)
UpdateMpaStatusIfNeeded updates the status field of the MPA API object.
Types ¶
type ContainerToAnnotationsMap ¶ added in v0.3.0
ContainerToAnnotationsMap contains annotations per container.
type MpaWithSelector ¶ added in v0.3.0
type MpaWithSelector struct { Mpa *mpa_types.MultidimPodAutoscaler Selector labels.Selector }
MpaWithSelector is a pair of MPA and its selector.
func GetControllingMPAForPod ¶ added in v0.3.0
func GetControllingMPAForPod(pod *core.Pod, mpas []*MpaWithSelector) *MpaWithSelector
GetControllingMPAForPod chooses the earliest created MPA from the input list that matches the given Pod.
type RecommendationProcessor ¶ added in v0.3.0
type RecommendationProcessor interface { // Apply processes and updates recommendation for given pod, based on container limits, // VPA policy and possibly other internal RecommendationProcessor context. // Must return a non-nil pointer to RecommendedPodResources or error. Apply(podRecommendation *vpa_types.RecommendedPodResources, policy *vpa_types.PodResourcePolicy, conditions []mpa_types.MultidimPodAutoscalerCondition, pod *v1.Pod) (*vpa_types.RecommendedPodResources, ContainerToAnnotationsMap, error) }
RecommendationProcessor post-processes recommendation adjusting it to limits and environment context
func NewCappingRecommendationProcessor ¶ added in v0.3.0
func NewCappingRecommendationProcessor(limitsRangeCalculator limitrange.LimitRangeCalculator) RecommendationProcessor
NewCappingRecommendationProcessor constructs new RecommendationsProcessor that adjusts recommendation for given pod to obey MPA resources policy and container limits