controller

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

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

type ClusterManager struct {
	ClusterNamer *utils.Namer
	// contains filtered or unexported fields
}

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

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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