Documentation ¶
Index ¶
- func FindOrphanClusters(awsConfigs []v1alpha1.AWSConfig, resourceNames []string) []string
- func FindOrphanResources(clusterIDs []string, resourceNames []string) []string
- func IsInvalidConfig(err error) bool
- type Config
- type Service
- func (s *Service) FindDuplicateMasterNodes(clusterIDs []string) error
- func (s Service) ListClusterIDs(awsConfigs []v1alpha1.AWSConfig) ([]string, error)
- func (s Service) ListClusters() ([]v1alpha1.AWSConfig, error)
- func (s *Service) ListMasterInstances(clusterID string) ([]string, error)
- func (s *Service) ListVpcs() ([]string, error)
- func (s *Service) OrphanClustersAlert(awsConfigs []v1alpha1.AWSConfig) error
- func (s *Service) OrphanResourcesAlert(clusterIDs []string) error
- func (s *Service) RunAllChecks() error
- func (s *Service) StartAlerts()
- func (s Service) UpdateDuplicateResourceMetrics(resourceType string, clusterIDs []string)
- func (s Service) UpdateOrphanClusterMetrics(resourceType string, clusterIDs []string)
- func (s Service) UpdateOrphanResourceMetrics(resourceType string, resourceIDs []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindOrphanClusters ¶
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 ¶
FindOrphanResources compares a list of cluster IDs and resource names. It returns any resources not associated with a cluster.
func IsInvalidConfig ¶
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 (*Service) FindDuplicateMasterNodes ¶
FindDuplicateMasterNodes looks for clusters with duplicate master nodes which is an error state.
func (Service) ListClusterIDs ¶
ListClusterIDs lists the cluster custom objects IDs.
func (Service) ListClusters ¶
ListClusters lists the cluster custom objects.
func (*Service) ListMasterInstances ¶
ListMasterInstances lists the master instances for this cluster.
func (*Service) ListVpcs ¶
ListVpcs lists the VPCs in this installation and returns the clusterIDs associated with them.
func (*Service) OrphanClustersAlert ¶
OrphanClustersAlert looks for clusters without AWS resources associated.
func (*Service) OrphanResourcesAlert ¶
OrphanResourcesAlert looks for AWS resources not associated with a cluster.
func (*Service) RunAllChecks ¶
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 ¶
UpdateDuplicateResourceMetrics updates the metric and logs the results.
func (Service) UpdateOrphanClusterMetrics ¶
UpdateOrphanClusterMetrics updates the metric and logs the results.
func (Service) UpdateOrphanResourceMetrics ¶
UpdateOrphanResourceMetrics updates the metric and logs the results.