Documentation ¶
Overview ¶
Package resources contains methods for manipulating K8s resources shared between different PA implementations.
Index ¶
- func MakeMetric(ctx context.Context, pa *v1alpha1.PodAutoscaler, metricSvc string, ...) *autoscaler.Metric
- func MakeMetricsService(pa *pav1alpha1.PodAutoscaler, selector map[string]string) *corev1.Service
- func MakeSKS(pa *pav1alpha1.PodAutoscaler, mode nv1a1.ServerlessServiceOperationMode) *nv1a1.ServerlessService
- func ResolveConcurrency(pa *v1alpha1.PodAutoscaler, config *autoscaler.Config) float64
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeMetric ¶ added in v0.7.0
func MakeMetric(ctx context.Context, pa *v1alpha1.PodAutoscaler, metricSvc string, config *autoscaler.Config) *autoscaler.Metric
MakeMetric constructs a Metric resource from a PodAutoscaler
func MakeMetricsService ¶ added in v0.7.0
func MakeMetricsService(pa *pav1alpha1.PodAutoscaler, selector map[string]string) *corev1.Service
MakeMetricsService constructs a service that can be scraped for metrics.
func MakeSKS ¶
func MakeSKS(pa *pav1alpha1.PodAutoscaler, mode nv1a1.ServerlessServiceOperationMode) *nv1a1.ServerlessService
MakeSKS makes an SKS resource from the PA and operation mode.
func ResolveConcurrency ¶ added in v0.7.0
func ResolveConcurrency(pa *v1alpha1.PodAutoscaler, config *autoscaler.Config) float64
ResolveConcurrency takes concurrency knobs from multiple locations and resolves them to the final value to be used by the autoscaler.
Types ¶
type Metrics ¶ added in v0.7.0
type Metrics interface { // Get accesses the Metric resource for this key, returning any errors. Get(ctx context.Context, namespace, name string) (*autoscaler.Metric, error) // Create adds a Metric resource for a given key, returning any errors. Create(ctx context.Context, metric *autoscaler.Metric) (*autoscaler.Metric, error) // Delete removes the Metric resource for a given key, returning any errors. Delete(ctx context.Context, namespace, name string) error // Update update the Metric resource, return the new Metric or any errors. Update(ctx context.Context, metric *autoscaler.Metric) (*autoscaler.Metric, error) }
Metrics is an interface for notifying the presence or absence of metric collection.
Click to show internal directories.
Click to hide internal directories.