verticalpodautoscaler

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdmissionPluginArgs

func AdmissionPluginArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string

AdmissionPluginArgs returns a slice of strings representing command line arguments to the recommnder corresponding to the values in the given VerticalPodAutoscalerController resource.

func RecommenderArgs

func RecommenderArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string

RecommenderArgs returns a slice of strings representing command line arguments to the recommnder corresponding to the values in the given VerticalPodAutoscalerController resource.

func UpdaterArgs

func UpdaterArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string

UpdaterArgs returns a slice of strings representing command line arguments to the recommnder corresponding to the values in the given VerticalPodAutoscalerController resource.

Types

type AdmissionPluginArg

type AdmissionPluginArg string

AdmissionPluginArg represents a command line argument to the VPA's recommender that may be combined with a value or numerical range.

func (AdmissionPluginArg) String

func (a AdmissionPluginArg) String() string

String returns the argument as a plain string.

func (AdmissionPluginArg) Value

func (a AdmissionPluginArg) Value(v interface{}) string

Value returns the argument with the given value set.

type Config

type Config struct {
	// The release version assigned to the operator config.
	ReleaseVersion string
	// The name of the singleton VerticalPodAutoscalerController resource.
	Name string
	// The namespace for vertical-pod-autoscaler deployments.
	Namespace string
	// The vertical-pod-autoscaler image to use in deployments.
	Image string
	// The log verbosity level for the vertical-pod-autoscaler.
	Verbosity int
	// Additional arguments passed to the vertical-pod-autoscaler.
	ExtraArgs string
}

Config represents the configuration for a reconciler instance.

type RecommenderArg

type RecommenderArg string

RecommenderArg represents a command line argument to the VPA's recommender that may be combined with a value or numerical range.

const (
	LogToStderrArg          RecommenderArg = "--logtostderr"
	VerbosityArg            RecommenderArg = "--v"
	SafetyMarginFractionArg RecommenderArg = "--recommendation-margin-fraction"
	PodMinCPUMillicoresArg  RecommenderArg = "--pod-recommendation-min-cpu-millicores"
	PodMinMemoryMbArg       RecommenderArg = "--pod-recommendation-min-memory-mb"
)

These constants represent the vertical-pod-autoscaler arguments used by the operator when processing VerticalPodAutoscalerController resources.

func (RecommenderArg) String

func (a RecommenderArg) String() string

String returns the argument as a plain string.

func (RecommenderArg) Value

func (a RecommenderArg) Value(v interface{}) string

Value returns the argument with the given value set.

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler reconciles a VerticalPodAutoscalerController object

func NewReconciler

func NewReconciler(mgr manager.Manager, cfg *Config) *Reconciler

NewReconciler returns a new Reconciler.

func (*Reconciler) AddToManager

func (r *Reconciler) AddToManager(mgr manager.Manager) error

AddToManager adds a new Controller to mgr with r as the reconcile.Reconciler

func (*Reconciler) AutoscalerDeployment

AutoscalerDeployment returns the expected deployment belonging to the given VerticalPodAutoscalerController.

func (*Reconciler) CreateAutoscaler

CreateAutoscaler will create the deployment for the given the VerticalPodAutoscalerController custom resource instance.

func (*Reconciler) GetAutoscaler

GetAutoscaler will return the deployment for the given VerticalPodAutoscalerController custom resource instance.

func (*Reconciler) NamePredicate

func (r *Reconciler) NamePredicate(meta metav1.Object) bool

NamePredicate is used in predicate functions. It returns true if the object's name matches the configured name of the singleton VerticalPodAutoscalerController resource.

func (*Reconciler) RecommenderName

RecommenderName returns the expected NamespacedName for the deployment belonging to the given VerticalPodAutoscalerController.

func (*Reconciler) RecommenderPodSpec

RecommenderPodSpec returns the expected podSpec for the deployment belonging to the given VerticalPodAutoscalerController.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a VerticalPodAutoscalerController object and makes changes based on the state read and what is in the VerticalPodAutoscalerController.Spec

func (*Reconciler) SetConfig

func (r *Reconciler) SetConfig(cfg *Config)

SetConfig sets the given config on the reconciler.

func (*Reconciler) UpdateAnnotations

func (r *Reconciler) UpdateAnnotations(obj metav1.Object)

UpdateAnnotations updates the annotations on the given object to the values currently expected by the controller.

func (*Reconciler) UpdateAutoscaler

UpdateAutoscaler will retrieve the deployment for the given VerticalPodAutoscalerController custom resource instance and update it to match the expected spec if needed.

type UpdaterArg

type UpdaterArg string

UpdaterArg represents a command line argument to the VPA's recommender that may be combined with a value or numerical range.

func (UpdaterArg) String

func (a UpdaterArg) String() string

String returns the argument as a plain string.

func (UpdaterArg) Value

func (a UpdaterArg) Value(v interface{}) string

Value returns the argument with the given value set.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator validates VerticalPodAutoscalerController resources.

func (*Validator) InjectClient

func (v *Validator) InjectClient(c client.Client) error

InjectClient injects the client.

func (*Validator) InjectDecoder

func (v *Validator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

Jump to

Keyboard shortcuts

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