Documentation ¶
Index ¶
- func AdmissionPluginArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string
- func RecommenderArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string
- func UpdaterArgs(vpa *v1.VerticalPodAutoscalerController, cfg *Config) []string
- type AdmissionPluginArg
- type Config
- type RecommenderArg
- type Reconciler
- func (r *Reconciler) AddToManager(mgr manager.Manager) error
- func (r *Reconciler) AutoscalerDeployment(vpa *autoscalingv1.VerticalPodAutoscalerController) *appsv1.Deployment
- func (r *Reconciler) CreateAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) error
- func (r *Reconciler) GetAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) (*appsv1.Deployment, error)
- func (r *Reconciler) NamePredicate(meta metav1.Object) bool
- func (r *Reconciler) RecommenderName(vpa *autoscalingv1.VerticalPodAutoscalerController) types.NamespacedName
- func (r *Reconciler) RecommenderPodSpec(vpa *autoscalingv1.VerticalPodAutoscalerController) *corev1.PodSpec
- func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)
- func (r *Reconciler) SetConfig(cfg *Config)
- func (r *Reconciler) UpdateAnnotations(obj metav1.Object)
- func (r *Reconciler) UpdateAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) error
- type UpdaterArg
- type Validator
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 ¶
func (r *Reconciler) AutoscalerDeployment(vpa *autoscalingv1.VerticalPodAutoscalerController) *appsv1.Deployment
AutoscalerDeployment returns the expected deployment belonging to the given VerticalPodAutoscalerController.
func (*Reconciler) CreateAutoscaler ¶
func (r *Reconciler) CreateAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) error
CreateAutoscaler will create the deployment for the given the VerticalPodAutoscalerController custom resource instance.
func (*Reconciler) GetAutoscaler ¶
func (r *Reconciler) GetAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) (*appsv1.Deployment, error)
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 ¶
func (r *Reconciler) RecommenderName(vpa *autoscalingv1.VerticalPodAutoscalerController) types.NamespacedName
RecommenderName returns the expected NamespacedName for the deployment belonging to the given VerticalPodAutoscalerController.
func (*Reconciler) RecommenderPodSpec ¶
func (r *Reconciler) RecommenderPodSpec(vpa *autoscalingv1.VerticalPodAutoscalerController) *corev1.PodSpec
RecommenderPodSpec returns the expected podSpec for the deployment belonging to the given VerticalPodAutoscalerController.
func (*Reconciler) Reconcile ¶
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 ¶
func (r *Reconciler) UpdateAutoscaler(vpa *autoscalingv1.VerticalPodAutoscalerController) error
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 ¶
InjectClient injects the client.