Documentation ¶
Index ¶
- func GetLogAttrsFromWpa(wpa *datadoghqv1alpha1.WatermarkPodAutoscaler) ([]interface{}, error)
- type ReplicaCalculation
- type ReplicaCalculator
- func (c *ReplicaCalculator) GetExternalMetricReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, ...) (ReplicaCalculation, error)
- func (c *ReplicaCalculator) GetResourceReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, ...) (ReplicaCalculation, error)
- type ReplicaCalculatorItf
- type WatermarkPodAutoscalerReconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogAttrsFromWpa ¶ added in v0.4.0
func GetLogAttrsFromWpa(wpa *datadoghqv1alpha1.WatermarkPodAutoscaler) ([]interface{}, error)
GetLogAttrsFromWpa returns a slice of all key/value pairs specified in the WPA log attributes annotation json.
Types ¶
type ReplicaCalculation ¶
type ReplicaCalculation struct {
// contains filtered or unexported fields
}
ReplicaCalculation is used to compute the scaling recommendation.
type ReplicaCalculator ¶
type ReplicaCalculator struct {
// contains filtered or unexported fields
}
ReplicaCalculator is responsible for calculation of the number of replicas It contains all the needed information
func NewReplicaCalculator ¶
func NewReplicaCalculator(metricsClient metricsclient.MetricsClient, podLister corelisters.PodLister) *ReplicaCalculator
NewReplicaCalculator returns a ReplicaCalculator object reference
func (*ReplicaCalculator) GetExternalMetricReplicas ¶
func (c *ReplicaCalculator) GetExternalMetricReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, wpa *v1alpha1.WatermarkPodAutoscaler) (ReplicaCalculation, error)
GetExternalMetricReplicas calculates the desired replica count based on a target metric value (as a milli-value) for the external metric in the given namespace, and the current replica count.
func (*ReplicaCalculator) GetResourceReplicas ¶
func (c *ReplicaCalculator) GetResourceReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, wpa *v1alpha1.WatermarkPodAutoscaler) (ReplicaCalculation, error)
GetResourceReplicas calculates the desired replica count based on a target resource utilization percentage of the given resource for pods matching the given selector in the given namespace, and the current replica count
type ReplicaCalculatorItf ¶
type ReplicaCalculatorItf interface { GetExternalMetricReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, wpa *v1alpha1.WatermarkPodAutoscaler) (replicaCalculation ReplicaCalculation, err error) GetResourceReplicas(logger logr.Logger, target *autoscalingv1.Scale, metric v1alpha1.MetricSpec, wpa *v1alpha1.WatermarkPodAutoscaler) (replicaCalculation ReplicaCalculation, err error) }
ReplicaCalculatorItf interface for ReplicaCalculator
type WatermarkPodAutoscalerReconciler ¶
type WatermarkPodAutoscalerReconciler struct { // This client, initialized using mgr.Client() above, is a split client // that reads objects from the cache and writes to the apiserver Client client.Client Log logr.Logger Scheme *runtime.Scheme // contains filtered or unexported fields }
WatermarkPodAutoscalerReconciler reconciles a WatermarkPodAutoscaler object
func (*WatermarkPodAutoscalerReconciler) Reconcile ¶
func (r *WatermarkPodAutoscalerReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)
Reconcile reads that state of the cluster for a WatermarkPodAutoscaler object and makes changes based on the state read and what is in the WatermarkPodAutoscaler.Spec The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*WatermarkPodAutoscalerReconciler) SetupWithManager ¶
func (r *WatermarkPodAutoscalerReconciler) SetupWithManager(mgr ctrl.Manager, workers int) error
SetupWithManager creates a new Watermarkpodautoscaler controller