Documentation ¶
Index ¶
- func NewFakeClusterManager(clusterName, firewallName string) *fakeClusterManager
- type ClusterManager
- func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error)
- func (c *ClusterManager) GC(lbNames []string, nodePorts []utils.ServicePort) error
- func (c *ClusterManager) Init(zl instances.ZoneLister, pp backends.ProbeProvider)
- type LoadBalancerController
- type NodeController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeClusterManager ¶
func NewFakeClusterManager(clusterName, firewallName string) *fakeClusterManager
NewFakeClusterManager creates a new fake ClusterManager.
Types ¶
type ClusterManager ¶
ClusterManager manages cluster resource pools.
func NewClusterManager ¶
func NewClusterManager( ctx *context.ControllerContext, namer *utils.Namer, healthCheckPath string, defaultBackendHealthCheckPath string) (*ClusterManager, error)
NewClusterManager creates a cluster manager for shared resources.
- namer: is the namer used to tag cluster wide shared resources.
- defaultBackendNodePort: is the node port of glbc's default backend. This is the kubernetes Service that serves the 404 page if no urls match.
- healthCheckPath: is the default path used for L7 health checks, eg: "/healthz".
- defaultBackendHealthCheckPath: is the default path used for the default backend health checks.
func (*ClusterManager) EnsureInstanceGroupsAndPorts ¶
func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error)
func (*ClusterManager) GC ¶
func (c *ClusterManager) GC(lbNames []string, nodePorts []utils.ServicePort) error
GC garbage collects unused resources.
- lbNames are the names of L7 loadbalancers we wish to exist. Those not in this list are removed from the cloud.
- nodePorts are the ports for which we want BackendServies. BackendServices for ports not in this list are deleted.
This method ignores googleapi 404 errors (StatusNotFound).
func (*ClusterManager) Init ¶
func (c *ClusterManager) Init(zl instances.ZoneLister, pp backends.ProbeProvider)
Init initializes the cluster manager.
type LoadBalancerController ¶
type LoadBalancerController struct { // TODO: Watch secrets CloudClusterManager *ClusterManager Translator *translator.Translator // contains filtered or unexported fields }
LoadBalancerController watches the kubernetes api and adds/removes services from the loadbalancer, via loadBalancerConfig.
func NewLoadBalancerController ¶
func NewLoadBalancerController( ctx *context.ControllerContext, clusterManager *ClusterManager, stopCh chan struct{}) *LoadBalancerController
NewLoadBalancerController creates a controller for gce loadbalancers.
- clusterManager: A ClusterManager capable of creating all cloud resources required for L7 loadbalancing.
- resyncPeriod: Watchers relist from the Kubernetes API server this often.
func (*LoadBalancerController) IsHealthy ¶ added in v1.3.0
func (lbc *LoadBalancerController) IsHealthy() (err error)
IsHealthy returns an error if the cluster manager is unhealthy.
func (*LoadBalancerController) Run ¶
func (lbc *LoadBalancerController) Run()
Run starts the loadbalancer controller.
func (*LoadBalancerController) Stop ¶
func (lbc *LoadBalancerController) Stop(deleteAll bool) error
Stop stops the loadbalancer controller. It also deletes cluster resources if deleteAll is true.
func (*LoadBalancerController) ToSvcPorts ¶ added in v1.2.2
func (lbc *LoadBalancerController) ToSvcPorts(ings *extensions.IngressList) []utils.ServicePort
ToSvcPorts is a helper method over translator.TranslateIngress to process a list of ingresses. Note: This method is used for GC.
type NodeController ¶
type NodeController struct {
// contains filtered or unexported fields
}
NodeController synchronizes the state of the nodes to the unmanaged instance groups.
func NewNodeController ¶
func NewNodeController(ctx *context.ControllerContext, cm *ClusterManager) *NodeController
NewNodeController returns a new node update controller.
func (*NodeController) Run ¶
func (c *NodeController) Run(stopCh chan struct{})
Run a go routine to process updates for the controller.
func (*NodeController) Shutdown ¶
func (c *NodeController) Shutdown()
Run a go routine to process updates for the controller.