alerter

package
v0.0.0-...-17b5b8b Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindOrphanClusters

func FindOrphanClusters(awsConfigs []v1alpha1.AWSConfig, resourceNames []string) []string

FindOrphanClusters compares a list of cluster IDs and resource names. It returns the IDs of any cluster created a reasonable amount of time ago without resources associated.

func FindOrphanResources

func FindOrphanResources(clusterIDs []string, resourceNames []string) []string

FindOrphanResources compares a list of cluster IDs and resource names. It returns any resources not associated with a cluster.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	// Dependencies.
	G8sClient versioned.Interface
	Logger    micrologger.Logger

	// Settings.
	AwsConfig        awsutil.Config
	InstallationName string
}

Config represents the configuration used to create a new service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new service by best effort.

type Service

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

Service implements the service interface.

func New

func New(config Config) (*Service, error)

New creates a new configured service.

func (*Service) FindDuplicateMasterNodes

func (s *Service) FindDuplicateMasterNodes(clusterIDs []string) error

FindDuplicateMasterNodes looks for clusters with duplicate master nodes which is an error state.

func (Service) ListClusterIDs

func (s Service) ListClusterIDs(awsConfigs []v1alpha1.AWSConfig) ([]string, error)

ListClusterIDs lists the cluster custom objects IDs.

func (Service) ListClusters

func (s Service) ListClusters() ([]v1alpha1.AWSConfig, error)

ListClusters lists the cluster custom objects.

func (*Service) ListMasterInstances

func (s *Service) ListMasterInstances(clusterID string) ([]string, error)

ListMasterInstances lists the master instances for this cluster.

func (*Service) ListVpcs

func (s *Service) ListVpcs() ([]string, error)

ListVpcs lists the VPCs in this installation and returns the clusterIDs associated with them.

func (*Service) OrphanClustersAlert

func (s *Service) OrphanClustersAlert(awsConfigs []v1alpha1.AWSConfig) error

OrphanClustersAlert looks for clusters without AWS resources associated.

func (*Service) OrphanResourcesAlert

func (s *Service) OrphanResourcesAlert(clusterIDs []string) error

OrphanResourcesAlert looks for AWS resources not associated with a cluster.

func (*Service) RunAllChecks

func (s *Service) RunAllChecks() error

RunAllChecks looks for problems with clusters that we want to alert on.

func (*Service) StartAlerts

func (s *Service) StartAlerts()

StartAlerts starts a background ticker that checks for orphan resources.

func (Service) UpdateDuplicateResourceMetrics

func (s Service) UpdateDuplicateResourceMetrics(resourceType string, clusterIDs []string)

UpdateDuplicateResourceMetrics updates the metric and logs the results.

func (Service) UpdateOrphanClusterMetrics

func (s Service) UpdateOrphanClusterMetrics(resourceType string, clusterIDs []string)

UpdateOrphanClusterMetrics updates the metric and logs the results.

func (Service) UpdateOrphanResourceMetrics

func (s Service) UpdateOrphanResourceMetrics(resourceType string, resourceIDs []string)

UpdateOrphanResourceMetrics updates the metric and logs the results.

Jump to

Keyboard shortcuts

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