Documentation ¶
Index ¶
- Constants
- type AppServiceHandler
- type ClbIngressStatus
- type CloudListenerStatus
- type HandlerProcessor
- type IngressHandler
- type ListenerHandler
- type NodeHandler
- type Option
- type Processor
- func (p *Processor) Collect(ch chan<- prometheus.Metric)
- func (p *Processor) Describe(ch chan<- *prometheus.Desc)
- func (p *Processor) GetStatusFunction() restful.RouteFunction
- func (p *Processor) Handle()
- func (p *Processor) Init() error
- func (p *Processor) Run()
- func (p *Processor) SetUpdated()
- func (p *Processor) Stop()
- type RemoteListenerStatus
- type Status
- type StatusResponse
- type Updater
Constants ¶
const ( // StatusCodeSuccess code for success status StatusCodeSuccess = 0 // StatusCodeError code for error status StatusCodeError = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppServiceHandler ¶
type AppServiceHandler struct {
// contains filtered or unexported fields
}
AppServiceHandler handler for AppService
func NewAppServiceHandler ¶
func NewAppServiceHandler() *AppServiceHandler
NewAppServiceHandler create AppService handler
func (*AppServiceHandler) OnAdd ¶
func (handler *AppServiceHandler) OnAdd(obj interface{})
OnAdd AppService add event
func (*AppServiceHandler) OnDelete ¶
func (handler *AppServiceHandler) OnDelete(obj interface{})
OnDelete AppService delete event
func (*AppServiceHandler) OnUpdate ¶
func (handler *AppServiceHandler) OnUpdate(objOld, objNew interface{})
OnUpdate AppService update event
func (*AppServiceHandler) RegisterProcessor ¶
func (handler *AppServiceHandler) RegisterProcessor(p HandlerProcessor)
RegisterProcessor register processor to handler
type ClbIngressStatus ¶
type ClbIngressStatus struct { Name string Namespace string clbingressType.ClbIngressSpec clbingressType.ClbIngressStatus AppSvcs map[string]*serviceclient.AppService }
ClbIngressStatus clb ingress status
type CloudListenerStatus ¶
type CloudListenerStatus struct { Name string Namespace string cloudListenerType.CloudListenerSpec }
CloudListenerStatus cloud listener status
type HandlerProcessor ¶
type HandlerProcessor interface {
SetUpdated()
}
HandlerProcessor processor interface
type IngressHandler ¶
type IngressHandler struct {
// contains filtered or unexported fields
}
IngressHandler ingress handler
func NewIngressHandler ¶
func NewIngressHandler() *IngressHandler
NewIngressHandler create ingress handler
func (*IngressHandler) OnAdd ¶
func (handler *IngressHandler) OnAdd(obj interface{})
OnAdd ingress add event
func (*IngressHandler) OnDelete ¶
func (handler *IngressHandler) OnDelete(obj interface{})
OnDelete ingress delete event
func (*IngressHandler) OnUpdate ¶
func (handler *IngressHandler) OnUpdate(objOld, objNew interface{})
OnUpdate ingress update event
func (*IngressHandler) RegisterProcessor ¶
func (handler *IngressHandler) RegisterProcessor(p HandlerProcessor)
RegisterProcessor register processor to ingress handler
type ListenerHandler ¶
type ListenerHandler struct{}
ListenerHandler listener handler
func NewListenerHandler ¶
func NewListenerHandler() *ListenerHandler
NewListenerHandler create listener handler
func (*ListenerHandler) OnAdd ¶
func (handler *ListenerHandler) OnAdd(obj interface{})
OnAdd listener add event
func (*ListenerHandler) OnDelete ¶
func (handler *ListenerHandler) OnDelete(obj interface{})
OnDelete listener delete event
func (*ListenerHandler) OnUpdate ¶
func (handler *ListenerHandler) OnUpdate(objOld, objNew interface{})
OnUpdate listener update event
type NodeHandler ¶
type NodeHandler struct {
// contains filtered or unexported fields
}
NodeHandler node handler
func (*NodeHandler) OnDelete ¶
func (handler *NodeHandler) OnDelete(obj interface{})
OnDelete node delete event
func (*NodeHandler) OnUpdate ¶
func (handler *NodeHandler) OnUpdate(objOld, objNew interface{})
OnUpdate node update event
func (*NodeHandler) RegisterProcessor ¶
func (handler *NodeHandler) RegisterProcessor(p HandlerProcessor)
RegisterProcessor register processor to node handler
type Option ¶
type Option struct { Port int ServiceRegistry string ClbName string NetType string BackendIPType string Namespace string Cluster string Kubeconfig string UpdatePeriod int NodeSyncPeriod int SyncPeriod int }
Option processor options
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor processor for ingresses and services
func NewProcessor ¶
NewProcessor create processor for clb controller
func (*Processor) Collect ¶
func (p *Processor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus exporter Collect interface
func (*Processor) Describe ¶
func (p *Processor) Describe(ch chan<- *prometheus.Desc)
Describe implements promethues exporter Describe interface
func (*Processor) GetStatusFunction ¶
func (p *Processor) GetStatusFunction() restful.RouteFunction
GetStatusFunction get status function
type RemoteListenerStatus ¶
type RemoteListenerStatus struct { Name string cloudListenerType.CloudListenerSpec cloudListenerType.CloudListenerStatus }
RemoteListenerStatus remote listener status
type Status ¶
type Status struct { Ingresses []*ClbIngressStatus `json:"ingresses"` CloudListeners []*CloudListenerStatus `json:"cloudListeners"` RemoteListeners []*RemoteListenerStatus `json:"remoteListeners"` }
Status status
type StatusResponse ¶
type StatusResponse struct { Code int `json:"code"` Message string `json:"message"` Data *Status `json:"data,omitempty"` }
StatusResponse status response
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater generate listeners from ingress and service discovery
func NewUpdater ¶
func NewUpdater(opt *Option, svcClient svcclient.Client, ingressRegistry clbingress.Registry, listenerClient listenerclient.Interface) (*Updater, error)
NewUpdater create updater
func (*Updater) EnsureLoadBalancer ¶
EnsureLoadBalancer create new loadbalance cloud lb instance or take over existed cloud lb instance
func (*Updater) ListRemoteListener ¶
func (updater *Updater) ListRemoteListener() ([]*cloudListenerType.CloudListener, error)
ListRemoteListener list remote listener currently it calls cloud api directly TODO: cloud lb interface should has events informer this function should get remote listeners from local cache