Documentation ¶
Index ¶
- Constants
- Variables
- type PrometheusMonitor
- func (prom *PrometheusMonitor) CheckEqualIfDisabled(cluster *kstonev1alpha2.EtcdCluster) bool
- func (prom *PrometheusMonitor) CheckEqualIfEnabled(cluster *kstonev1alpha2.EtcdCluster) bool
- func (prom *PrometheusMonitor) CleanPrometheusMonitor(cluster *kstonev1alpha2.EtcdCluster) error
- func (prom *PrometheusMonitor) CreateEtcdEndpoint(ep *corev1.Endpoints) (*corev1.Endpoints, error)
- func (prom *PrometheusMonitor) CreateEtcdService(service *corev1.Service) (*corev1.Service, error)
- func (prom *PrometheusMonitor) CreateServiceMonitor(task *promapiv1.ServiceMonitor) (*promapiv1.ServiceMonitor, error)
- func (prom *PrometheusMonitor) DeleteEtcdService(namespace, name string) error
- func (prom *PrometheusMonitor) DeleteServiceMonitor(namespace, name string) error
- func (prom *PrometheusMonitor) EndpointIsEquivalent(old, new *corev1.Endpoints) bool
- func (prom *PrometheusMonitor) Equal(cluster *kstonev1alpha2.EtcdCluster) bool
- func (prom *PrometheusMonitor) GetEtcdEndpoint(namespace, name string) (*corev1.Endpoints, error)
- func (prom *PrometheusMonitor) GetEtcdService(namespace, name string) (*corev1.Service, error)
- func (prom *PrometheusMonitor) GetServiceMonitorTask(namespace, name string) (*promapiv1.ServiceMonitor, error)
- func (prom *PrometheusMonitor) IsMonitorEnabled(cluster *kstonev1alpha2.EtcdCluster) bool
- func (prom *PrometheusMonitor) ServiceIsEquivalent(old, new *corev1.Service) bool
- func (prom *PrometheusMonitor) ServiceMonitorIsEquivalent(old, new *promapiv1.ServiceMonitor) bool
- func (prom *PrometheusMonitor) SyncPrometheusMonitor(cluster *kstonev1alpha2.EtcdCluster) error
- func (prom *PrometheusMonitor) UnpackEndPointSubsets(endpoint *corev1.Endpoints) ([]string, error)
- func (prom *PrometheusMonitor) UpdateEtcdEndpoint(ep *corev1.Endpoints) (*corev1.Endpoints, error)
- func (prom *PrometheusMonitor) UpdateEtcdService(service *corev1.Service) (*corev1.Service, error)
- func (prom *PrometheusMonitor) UpdateServiceMonitor(task *promapiv1.ServiceMonitor) (*promapiv1.ServiceMonitor, error)
- func (prom *PrometheusMonitor) UpdateServiceMonitorSpec(task *promapiv1.ServiceMonitor) (*promapiv1.ServiceMonitor, error)
Constants ¶
const ( DefaultEtcdV3SecretName = "etcd-v3-certs" EtcdTLSPrefix = "/etc/prometheus/secrets/" DefaultEtcdPromNamespace = "kstone" )
Variables ¶
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 ¶
CreateEtcdEndpoint creates endpoints
func (*PrometheusMonitor) CreateEtcdService ¶
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 ¶
UpdateEtcdEndpoint updates endpoints
func (*PrometheusMonitor) UpdateEtcdService ¶
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