apimock

package
v0.0.0-...-5e778ce Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package apimock contains temporary definitions of Vertical Pod Autoscaler related objects - to be replaced with real implementation Definitions based on VPA design doc : https://github.com/kubernetes/community/pull/338

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerPolicy

type ContainerPolicy struct {
	// Name of the container
	Name string
	// Memory allocation policy
	ResourcePolicy map[apiv1.ResourceName]Policy
}

ContainerPolicy hold resources allocation policy for single container

type ContainerRecommendation

type ContainerRecommendation struct {
	// Name of the container
	Name string
	// Resources allocation recommended
	Resources map[apiv1.ResourceName]resource.Quantity
}

ContainerRecommendation holds resource allocation recommendation for container

type Mode

type Mode struct {
}

Mode of update policy

type Policy

type Policy struct {
	// Minimal resource quantity
	Min resource.Quantity
	// Maximal resource quantity
	Max resource.Quantity
}

Policy holds resource allocation policy

type Recommendation

type Recommendation struct {
	// Recommended resources allocation for containers
	Containers []ContainerRecommendation
}

Recommendation represents resources allocation recommended by Vertical Pod Autoscaler

type RecommenderAPI

type RecommenderAPI interface {
	// GetRecommendation returns Vertical Pod Autoscaler recommendation for given pod
	GetRecommendation(spec *apiv1.PodSpec) (*Recommendation, error)
}

RecommenderAPI defines api returning Vertical Pod Autoscaler recommendations for pods

func NewRecommenderAPI

func NewRecommenderAPI() RecommenderAPI

NewRecommenderAPI return mock RecommenderAPI - to be replaced with real implementation

type ResourcesPolicy

type ResourcesPolicy struct {
	// Resources allocation policy for containers
	Containers []ContainerPolicy
}

ResourcesPolicy represents Resources allocation policy

type Spec

type Spec struct {
	// Defines which pods this Autoscaler should watch and update
	Target Target
	// Policy for pod updates
	UpdatePolicy UpdatePolicy
	// Policy for container resources updates
	ResourcesPolicy ResourcesPolicy
}

Spec holds Vertical Pod Autoscaler configuration

type Status

type Status struct {
	// Recommended resources allocation
	Recommendation *Recommendation
}

Status holds current Vertical Pod Autoscaler state

type Target

type Target struct {
	// label query over pods. The string will be in the same format as the query-param syntax.
	// More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
	// +optional
	Selector string `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
}

Target Specifies pods to be managed by Vertical Pod Autoscaler

type UpdatePolicy

type UpdatePolicy struct {
	// Mode for update policy
	Mode Mode
}

UpdatePolicy defines policy for Pod updates

type VerticalPodAutoscaler

type VerticalPodAutoscaler struct {
	// Specification
	Spec Spec
	// Current state of VPA
	Status Status
}

VerticalPodAutoscaler Represents Vertical Pod Autoscaler configuration - to be replaced by real implementation

type VerticalPodAutoscalerLister

type VerticalPodAutoscalerLister interface {
	// List returns all configured Vertical Pod Autoscalers
	List() (ret []*VerticalPodAutoscaler, err error)
}

VerticalPodAutoscalerLister provides list of all configured Vertical Pod Autoscalers

func NewVpaLister

func NewVpaLister(_ interface{}) VerticalPodAutoscalerLister

NewVpaLister returns mock VerticalPodAutoscalerLister - to be replaced with real implementation

Jump to

Keyboard shortcuts

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