Documentation ¶
Index ¶
- Constants
- func GetAzureQueueLength(ctx context.Context, usePodIdentity bool, connectionString, queueName string, ...) (int32, error)
- func GetEventHubClient(connectionString string) (*eventhub.Hub, error)
- func GetQueueEntityFromNamespace(ctx context.Context, ns *servicebus.Namespace, queueName string) (int32, error)
- func GetStorageCredentials(storageConnection string) (azure.Environment, *azblob.SharedKeyCredential, error)
- func GetSubscriptionEntityFromNamespace(ctx context.Context, ns *servicebus.Namespace, ...) (int32, error)
- func NewLiiklusScaler(resolvedEnv map[string]string, metadata map[string]string) (*liiklusScaler, error)
- func ParseAzureEventHubConnectionString(connectionString string) (string, string, error)
- func ParseAzureStorageConnectionString(connectionString string) (string, string, string, string, error)
- type AADToken
- type AzureEventHubScaler
- func (scaler *AzureEventHubScaler) Close() error
- func (scaler *AzureEventHubScaler) GetMetricSpecForScaling() []v2beta1.MetricSpec
- func (scaler *AzureEventHubScaler) GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error)
- func (scaler *AzureEventHubScaler) GetUnprocessedEventCountInPartition(ctx context.Context, partitionID string) (newEventCount int64, err error)
- func (scaler *AzureEventHubScaler) IsActive(ctx context.Context) (bool, error)
- type Checkpoint
- type EntityType
- type EventHubMetadata
- type GoogleApplicationCredentials
- type Scaler
- func NewAwsCloudwatchScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewAwsSqsQueueScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewAzureEventHubScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewAzureQueueScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewAzureServiceBusScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewKafkaScaler(resolvedSecrets, metadata map[string]string) (Scaler, error)
- func NewPrometheusScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewPubSubScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewRabbitMQScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- func NewRedisScaler(resolvedEnv, metadata map[string]string) (Scaler, error)
- type StackDriverClient
Constants ¶
const (
MSI_URL = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fstorage.azure.com%2F"
)
Variables ¶
This section is empty.
Functions ¶
func GetAzureQueueLength ¶
func GetAzureQueueLength(ctx context.Context, usePodIdentity bool, connectionString, queueName string, accountName string) (int32, error)
GetAzureQueueLength returns the length of a queue in int
func GetEventHubClient ¶
GetEventHubClient returns eventhub client
func GetStorageCredentials ¶
func GetStorageCredentials(storageConnection string) (azure.Environment, *azblob.SharedKeyCredential, error)
GetStorageCredentials returns azure env and storage credentials
func NewLiiklusScaler ¶
func ParseAzureEventHubConnectionString ¶
ParseAzureEventHubConnectionString parses Event Hub connection string into (namespace, name)
Connection string should be in following format: Endpoint=sb://eventhub-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=secretKey123;EntityPath=eventhub-name
func ParseAzureStorageConnectionString ¶
func ParseAzureStorageConnectionString(connectionString string) (string, string, string, string, error)
ParseAzureStorageConnectionString parses a storage account connection string into (endpointProtocol, accountName, key, endpointSuffix)
Connection string should be in following format: DefaultEndpointsProtocol=https;AccountName=yourStorageAccountName;AccountKey=yourStorageAccountKey;EndpointSuffix=core.windows.net
Types ¶
type AADToken ¶
type AADToken struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn string `json:"expires_in"` ExpiresOn string `json:"expires_on"` NotBefore string `json:"not_before"` Resource string `json:"resource"` TokenType string `json:"token_type"` }
AADToken is the token from Azure AD
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, partitionID string) (newEventCount int64, err error)
GetUnprocessedEventCountInPartition gets number of unprocessed events in a given partition
type Checkpoint ¶
type Checkpoint struct { Epoch int64 `json:"Epoch"` Offset string `json:"Offset"` Owner string `json:"Owner"` PartitionID string `json:"PartitionId"` SequenceNumber int64 `json:"SequenceNumber"` Token string `json:"Token"` }
func GetCheckpointFromBlobStorage ¶
func GetCheckpointFromBlobStorage(ctx context.Context, partitionID string, eventHubMetadata EventHubMetadata) (Checkpoint, error)
GetCheckpointFromBlobStorage accesses Blob storage and gets checkpoint information of a partition
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 NewAwsCloudwatchScaler ¶
NewAwsCloudwatchScaler creates a new awsCloudwatchScaler
func NewAwsSqsQueueScaler ¶
NewAwsSqsQueueScaler creates a new awsSqsQueueScaler
func NewAzureEventHubScaler ¶
NewAzureEventHubScaler creates a new scaler for eventHub
func NewAzureQueueScaler ¶
NewAzureQueueScaler creates a new azureQueueScaler
func NewAzureServiceBusScaler ¶
NewAzureServiceBusScaler creates a new AzureServiceBusScaler
func NewKafkaScaler ¶
NewKafkaScaler creates a new kafkaScaler
func NewPrometheusScaler ¶
NewPrometheusScaler creates a new prometheusScaler
func NewPubSubScaler ¶
NewPubSubScaler creates a new pubsubScaler
func NewRabbitMQScaler ¶
NewRabbitMQScaler creates a new rabbitMQ scaler
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 ¶
GetMetrics fetches metrics from stackdriver for a specific filter for the last minute
Source Files ¶
- AzureStorage.go
- aws_cloudwatch_scaler.go
- aws_sqs_queue_scaler.go
- azure_aad_podidentity.go
- azure_eventhub.go
- azure_eventhub_scaler.go
- azure_queue.go
- azure_queue_scaler.go
- azure_servicebus_scaler.go
- gcp_pub_sub_scaler.go
- kafka_scaler.go
- liiklus_scaler.go
- prometheus.go
- rabbitmq_scaler.go
- redis_scaler.go
- scaler.go
- stackdriver_client.go