scalers

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 56 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
View Source
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }

Functions

func GetQueueEntityFromNamespace

func GetQueueEntityFromNamespace(ctx context.Context, ns *servicebus.Namespace, queueName string) (int32, error)

func GetSubscriptionEntityFromNamespace

func GetSubscriptionEntityFromNamespace(ctx context.Context, ns *servicebus.Namespace, topicName, subscriptionName string) (int32, error)

func GetUnprocessedEventCountWithoutCheckpoint added in v1.5.0

func GetUnprocessedEventCountWithoutCheckpoint(partitionInfo *eventhub.HubPartitionRuntimeInformation) int64

GetUnprocessedEventCountWithoutCheckpoint returns the number of messages on the without a checkoutpoint info

func NewLiiklusScaler

func NewLiiklusScaler(resolvedEnv map[string]string, metadata map[string]string) (*liiklusScaler, error)

Types

type AzureEventHubScaler

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

func (*AzureEventHubScaler) Close

func (scaler *AzureEventHubScaler) Close() error

Close closes Azure Event Hub Scaler

func (*AzureEventHubScaler) GetMetricSpecForScaling

func (scaler *AzureEventHubScaler) GetMetricSpecForScaling() []v2beta1.MetricSpec

GetMetricSpecForScaling returns metric spec

func (*AzureEventHubScaler) GetMetrics

func (scaler *AzureEventHubScaler) GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error)

GetMetrics returns metric using total number of unprocessed events in event hub

func (*AzureEventHubScaler) GetUnprocessedEventCountInPartition

func (scaler *AzureEventHubScaler) GetUnprocessedEventCountInPartition(ctx context.Context, partitionInfo *eventhub.HubPartitionRuntimeInformation) (newEventCount int64, checkpoint azure.Checkpoint, err error)

GetUnprocessedEventCountInPartition gets number of unprocessed events in a given partition

func (*AzureEventHubScaler) IsActive

func (scaler *AzureEventHubScaler) IsActive(ctx context.Context) (bool, error)

IsActive determines if eventhub is active based on number of unprocessed events

type EntityType

type EntityType int
const (
	None         EntityType = 0
	Queue        EntityType = 1
	Subscription EntityType = 2
)

type EventHubMetadata

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

type GoogleApplicationCredentials

type GoogleApplicationCredentials struct {
	Type                string `json:"type"`
	ProjectID           string `json:"project_id"`
	PrivateKeyID        string `json:"private_key_id"`
	PrivateKey          string `json:"private_key"`
	ClientEmail         string `json:"client_email"`
	ClientID            string `json:"client_id"`
	AuthURI             string `json:"auth_uri"`
	TokenURI            string `json:"token_uri"`
	AuthProviderCertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL   string `json:"client_x509_cert_url"`
}

GoogleApplicationCredentials is a struct representing the format of a service account credentials file

type Scaler

type Scaler interface {

	// The scaler returns the metric values for a metric Name and criteria matching the selector
	GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error)

	//returns the metrics based on which this scaler determines that the deployment scales. This is used to contruct the HPA spec that is created for
	// this scaled object. The labels used should match the selectors used in GetMetrics
	GetMetricSpecForScaling() []v2beta1.MetricSpec

	IsActive(ctx context.Context) (bool, error)

	// Close any resources that need disposing when scaler is no longer used or destroyed
	Close() error
}

func NewArtemisQueueScaler added in v1.5.0

func NewArtemisQueueScaler(resolvedSecrets, metadata, authParams map[string]string) (Scaler, error)

NewArtemisQueueScaler creates a new artemis queue Scaler

func NewAwsCloudwatchScaler

func NewAwsCloudwatchScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewAwsCloudwatchScaler creates a new awsCloudwatchScaler

func NewAwsKinesisStreamScaler

func NewAwsKinesisStreamScaler(resolvedEnv, metadata map[string]string, authParams map[string]string) (Scaler, error)

NewAwsKinesisStreamScaler creates a new awsKinesisStreamScaler

func NewAwsSqsQueueScaler

func NewAwsSqsQueueScaler(resolvedEnv, metadata map[string]string, authParams map[string]string) (Scaler, error)

NewAwsSqsQueueScaler creates a new awsSqsQueueScaler

func NewAzureBlobScaler

func NewAzureBlobScaler(resolvedEnv, metadata, authParams map[string]string, podIdentity string) (Scaler, error)

NewAzureBlobScaler creates a new azureBlobScaler

func NewAzureEventHubScaler

func NewAzureEventHubScaler(resolvedEnv, metadata map[string]string) (Scaler, error)

NewAzureEventHubScaler creates a new scaler for eventHub

func NewAzureMonitorScaler

func NewAzureMonitorScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewAzureMonitorScaler creates a new AzureMonitorScaler

func NewAzureQueueScaler

func NewAzureQueueScaler(resolvedEnv, metadata, authParams map[string]string, podIdentity string) (Scaler, error)

func NewAzureServiceBusScaler

func NewAzureServiceBusScaler(resolvedEnv, metadata, authParams map[string]string, podIdentity string) (Scaler, error)

NewAzureServiceBusScaler creates a new AzureServiceBusScaler

func NewCronScaler added in v1.5.0

func NewCronScaler(resolvedEnv, metadata map[string]string) (Scaler, error)

NewCronScaler creates a new cronScaler

func NewExternalScaler

func NewExternalScaler(name, namespace string, resolvedEnv, metadata map[string]string) (Scaler, error)

NewExternalScaler creates a new external scaler - calls the GRPC interface to create a new scaler

func NewHuaweiCloudeyeScaler

func NewHuaweiCloudeyeScaler(metadata, authParams map[string]string) (Scaler, error)

NewHuaweiCloudeyeScaler creates a new huaweiCloudeyeScaler

func NewKafkaScaler

func NewKafkaScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewKafkaScaler creates a new kafkaScaler

func NewMySQLScaler

func NewMySQLScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewMySQLScaler creates a new MySQL scaler

func NewPostgreSQLScaler

func NewPostgreSQLScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewPostgreSQLScaler creates a new postgreSQL scaler

func NewPrometheusScaler

func NewPrometheusScaler(resolvedEnv, metadata map[string]string) (Scaler, error)

NewPrometheusScaler creates a new prometheusScaler

func NewPubSubScaler

func NewPubSubScaler(resolvedEnv, metadata map[string]string) (Scaler, error)

NewPubSubScaler creates a new pubsubScaler

func NewRabbitMQScaler

func NewRabbitMQScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewRabbitMQScaler creates a new rabbitMQ scaler

func NewRedisScaler

func NewRedisScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewRedisScaler creates a new redisScaler

func NewRedisStreamsScaler added in v1.5.0

func NewRedisStreamsScaler(resolvedEnv, metadata, authParams map[string]string) (Scaler, error)

NewRedisStreamsScaler creates a new redisStreamsScaler

func NewStanScaler

func NewStanScaler(resolvedSecrets, metadata map[string]string) (Scaler, error)

NewStanScaler creates a new stanScaler

type StackDriverClient

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

StackDriverClient is a generic client to fetch metrics from Stackdriver. Can be used for a stackdriver scaler in the future

func NewStackDriverClient

func NewStackDriverClient(ctx context.Context, credentials string) (*StackDriverClient, error)

NewStackDriverClient creates a new stackdriver client with the credentials that are passed

func (StackDriverClient) GetMetrics

func (s StackDriverClient) GetMetrics(ctx context.Context, filter string) (int64, error)

GetMetrics fetches metrics from stackdriver for a specific filter for the last minute

type XDGSCRAMClient

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

func (*XDGSCRAMClient) Begin

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Directories

Path Synopsis
mocks
Package mock_liiklus is a generated GoMock package.
Package mock_liiklus is a generated GoMock package.

Jump to

Keyboard shortcuts

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