Documentation ¶
Index ¶
- Constants
- func NewFakeClusterManager(clusterName, firewallName string) *fakeClusterManager
- type ClusterManager
- func (c *ClusterManager) EnsureFirewall(nodeNames []string, endpointPorts []string) error
- func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error)
- func (c *ClusterManager) EnsureLoadBalancer(lb *loadbalancers.L7RuntimeInfo, lbServicePorts []utils.ServicePort, ...) error
- func (c *ClusterManager) GC(lbNames []string, nodePorts []utils.ServicePort) error
- func (c *ClusterManager) Init(zl instances.ZoneLister, pp backends.ProbeProvider)
- func (c *ClusterManager) IsHealthy() (err error)
- type LoadBalancerController
- type NodeController
- type StoreToIngressLister
- func (s *StoreToIngressLister) GetServiceIngress(svc *api_v1.Service, systemDefaultBackend utils.ServicePortID) (ings []extensions.Ingress, err error)
- func (s *StoreToIngressLister) ListAll() (ing extensions.IngressList, err error)
- func (s *StoreToIngressLister) ListGCEIngresses() (ing extensions.IngressList, err error)
Constants ¶
const (
// DefaultFirewallName is the default firewall name.
DefaultFirewallName = ""
)
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, defaultBackendSvcPortID utils.ServicePortID, 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) EnsureFirewall ¶ added in v1.0.1
func (c *ClusterManager) EnsureFirewall(nodeNames []string, endpointPorts []string) error
func (*ClusterManager) EnsureInstanceGroupsAndPorts ¶
func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error)
func (*ClusterManager) EnsureLoadBalancer ¶ added in v1.0.1
func (c *ClusterManager) EnsureLoadBalancer(lb *loadbalancers.L7RuntimeInfo, lbServicePorts []utils.ServicePort, igLinks []string) error
EnsureLoadBalancer creates the backend services and higher-level LB resources.
- lb is the single cluster L7 loadbalancers we wish to exist. If they already exist, they should not have any broken links between say, a UrlMap and TargetHttpProxy.
- lbServicePorts are the ports for which we require Backend Services.
- igLinks are the links to the groups to be referenced by the Backend Services.
If GCE runs out of quota, a googleapi 403 is returned.
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.
func (*ClusterManager) IsHealthy ¶
func (c *ClusterManager) IsHealthy() (err error)
IsHealthy returns an error if the cluster manager is unhealthy.
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, error)
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) 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.
type StoreToIngressLister ¶
StoreToIngressLister makes a Store that lists Ingress. TODO: Move this to cache/listers post 1.1.
func (*StoreToIngressLister) GetServiceIngress ¶
func (s *StoreToIngressLister) GetServiceIngress(svc *api_v1.Service, systemDefaultBackend utils.ServicePortID) (ings []extensions.Ingress, err error)
GetServiceIngress gets all the Ingress' that have rules pointing to a service. Note that this ignores services without the right nodePorts.
func (*StoreToIngressLister) ListAll ¶
func (s *StoreToIngressLister) ListAll() (ing extensions.IngressList, err error)
List lists all Ingress' in the store (both single and multi cluster ingresses).
func (*StoreToIngressLister) ListGCEIngresses ¶
func (s *StoreToIngressLister) ListGCEIngresses() (ing extensions.IngressList, err error)
ListGCEIngresses lists all GCE Ingress' in the store.