monitor

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEtcdV3SecretName  = "etcd-v3-certs"
	EtcdTLSPrefix            = "/etc/prometheus/secrets/"
	DefaultEtcdPromNamespace = "kstone"
)

Variables

View Source
var EtcdPromNamespace = os.Getenv("PROM_NAMESPACE")

Functions

This section is empty.

Types

type PrometheusMonitor

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

func NewPrometheusMonitor

func NewPrometheusMonitor(clientBuilder util.ClientBuilder) (*PrometheusMonitor, error)

NewPrometheusMonitor generates prometheus provider

func (*PrometheusMonitor) CheckEqualIfDisabled

func (prom *PrometheusMonitor) CheckEqualIfDisabled(cluster *kstonev1alpha2.EtcdCluster) bool

CheckEqualIfDisabled Checks whether the monitoring resource has been deleted if monitor feature is disabled.

func (*PrometheusMonitor) CheckEqualIfEnabled

func (prom *PrometheusMonitor) CheckEqualIfEnabled(cluster *kstonev1alpha2.EtcdCluster) bool

CheckEqualIfEnabled check whether the desired monitoring resources are consistent with the actual resources, if monitor feature is enabled.

func (*PrometheusMonitor) CleanPrometheusMonitor

func (prom *PrometheusMonitor) CleanPrometheusMonitor(cluster *kstonev1alpha2.EtcdCluster) error

CleanPrometheusMonitor cleans prometheus monitor for etcdcluster if it is disabled

func (*PrometheusMonitor) CreateEtcdEndpoint

func (prom *PrometheusMonitor) CreateEtcdEndpoint(ep *corev1.Endpoints) (*corev1.Endpoints, error)

CreateEtcdEndpoint creates endpoints

func (*PrometheusMonitor) CreateEtcdService

func (prom *PrometheusMonitor) CreateEtcdService(service *corev1.Service) (*corev1.Service, error)

CreateEtcdService creates service

func (*PrometheusMonitor) CreateServiceMonitor

func (prom *PrometheusMonitor) CreateServiceMonitor(task *promapiv1.ServiceMonitor) (*promapiv1.ServiceMonitor, error)

CreateServiceMonitor creates service monitor

func (*PrometheusMonitor) DeleteEtcdService

func (prom *PrometheusMonitor) DeleteEtcdService(namespace, name string) error

DeleteEtcdService deletes service

func (*PrometheusMonitor) DeleteServiceMonitor

func (prom *PrometheusMonitor) DeleteServiceMonitor(namespace, name string) error

DeleteServiceMonitor deletes service monitor

func (*PrometheusMonitor) EndpointIsEquivalent

func (prom *PrometheusMonitor) EndpointIsEquivalent(old, new *corev1.Endpoints) bool

EndpointIsEquivalent compares old endpoints with new endpoints

func (*PrometheusMonitor) Equal

func (prom *PrometheusMonitor) Equal(cluster *kstonev1alpha2.EtcdCluster) bool

Equal checks to Update ServiceMonitor & svc & ep, when label & memberIp change, update

func (*PrometheusMonitor) GetEtcdEndpoint

func (prom *PrometheusMonitor) GetEtcdEndpoint(namespace, name string) (*corev1.Endpoints, error)

GetEtcdEndpoint gets endpoints

func (*PrometheusMonitor) GetEtcdService

func (prom *PrometheusMonitor) GetEtcdService(namespace, name string) (*corev1.Service, error)

GetEtcdService gets service

func (*PrometheusMonitor) GetServiceMonitorTask

func (prom *PrometheusMonitor) GetServiceMonitorTask(namespace, name string) (*promapiv1.ServiceMonitor, error)

GetServiceMonitorTask gets service monitor by namespace and name

func (*PrometheusMonitor) IsMonitorEnabled

func (prom *PrometheusMonitor) IsMonitorEnabled(cluster *kstonev1alpha2.EtcdCluster) bool

func (*PrometheusMonitor) ServiceIsEquivalent

func (prom *PrometheusMonitor) ServiceIsEquivalent(old, new *corev1.Service) bool

ServiceIsEquivalent compares old service with old service

func (*PrometheusMonitor) ServiceMonitorIsEquivalent

func (prom *PrometheusMonitor) ServiceMonitorIsEquivalent(old, new *promapiv1.ServiceMonitor) bool

ServiceMonitorIsEquivalent compares old service monitor with new service monitor

func (*PrometheusMonitor) SyncPrometheusMonitor

func (prom *PrometheusMonitor) SyncPrometheusMonitor(cluster *kstonev1alpha2.EtcdCluster) error

SyncPrometheusMonitor syncs prometheus monitor for etcdcluster if it is enabled

func (*PrometheusMonitor) UnpackEndPointSubsets

func (prom *PrometheusMonitor) UnpackEndPointSubsets(endpoint *corev1.Endpoints) ([]string, error)

UnpackEndPointSubsets unpacks endpoint subnets

func (*PrometheusMonitor) UpdateEtcdEndpoint

func (prom *PrometheusMonitor) UpdateEtcdEndpoint(ep *corev1.Endpoints) (*corev1.Endpoints, error)

UpdateEtcdEndpoint updates endpoints

func (*PrometheusMonitor) UpdateEtcdService

func (prom *PrometheusMonitor) UpdateEtcdService(service *corev1.Service) (*corev1.Service, error)

UpdateEtcdService updates service

func (*PrometheusMonitor) UpdateServiceMonitor

func (prom *PrometheusMonitor) UpdateServiceMonitor(task *promapiv1.ServiceMonitor) (*promapiv1.ServiceMonitor, error)

UpdateServiceMonitor updates service monitor

func (*PrometheusMonitor) UpdateServiceMonitorSpec

func (prom *PrometheusMonitor) UpdateServiceMonitorSpec(task *promapiv1.ServiceMonitor) (
	*promapiv1.ServiceMonitor,
	error)

UpdateServiceMonitorSpec updates spec of service monitor

Jump to

Keyboard shortcuts

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