controller

package
v0.0.0-...-9d9bbfe Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultClusterUID is the uid to use for clusters resources created by an
	// L7 controller created without specifying the --cluster-uid flag.
	DefaultClusterUID = ""
)

Functions

func NewFakeClusterManager

func NewFakeClusterManager(clusterName string) *fakeClusterManager

NewFakeClusterManager creates a new fake ClusterManager.

func NewTaskQueue

func NewTaskQueue(syncFn func(string)) *taskQueue

NewTaskQueue creates a new task queue with the given sync function. The sync function is called for every element inserted into the queue.

Types

type ClusterManager

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

ClusterManager manages cluster resource pools.

func NewClusterManager

func NewClusterManager(
	name string,
	defaultBackendNodePort int64,
	defaultHealthCheckPath string) (*ClusterManager, error)

NewClusterManager creates a cluster manager for shared resources.

  • name: is the name used to tag cluster wide shared resources. This is the string passed to glbc via --gce-cluster-name.
  • defaultBackendNodePort: is the node port of glbc's default backend. This is the kubernetes Service that serves the 404 page if no urls match.
  • defaultHealthCheckPath: is the default path used for L7 health checks, eg: "/healthz"

func (*ClusterManager) Checkpoint

func (c *ClusterManager) Checkpoint(lbs []*loadbalancers.L7RuntimeInfo, nodeNames []string, nodePorts []int64) error

Checkpoint performs a checkpoint with the cloud.

  • lbNames are the names of L7 loadbalancers we wish to exist. If they already exist, they should not have any broken links between say, a UrlMap and TargetHttpProxy.
  • nodeNames are the names of nodes we wish to add to all loadbalancer instance groups.
  • nodePorts are the ports for which we require BackendServices. Each of these ports must also be opened on the corresponding Instance Group.

If in performing the checkpoint the cluster manager runs out of quota, a googleapi 403 is returned.

func (*ClusterManager) GC

func (c *ClusterManager) GC(lbNames []string, nodePorts []int64) 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) IsHealthy

func (c *ClusterManager) IsHealthy() (err error)

IsHealthy returns an error if the cluster manager is unhealthy.

type GCETranslator

type GCETranslator struct {
	*LoadBalancerController
}

GCETranslator helps with kubernetes -> gce api conversion.

type LoadBalancerController

type LoadBalancerController struct {
	CloudClusterManager *ClusterManager
	// contains filtered or unexported fields
}

LoadBalancerController watches the kubernetes api and adds/removes services from the loadbalancer, via loadBalancerConfig.

func NewLoadBalancerController

func NewLoadBalancerController(kubeClient *client.Client, clusterManager *ClusterManager, resyncPeriod time.Duration, namespace string) (*LoadBalancerController, error)

NewLoadBalancerController creates a controller for gce loadbalancers.

  • kubeClient: A kubernetes REST client.
  • 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) ListRuntimeInfo

func (lbc *LoadBalancerController) ListRuntimeInfo() (lbs []*loadbalancers.L7RuntimeInfo, err error)

ListRuntimeInfo lists L7RuntimeInfo as understood by the loadbalancer module.

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.

type StoreToIngressLister

type StoreToIngressLister struct {
	cache.Store
}

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.Service) (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) List

func (s *StoreToIngressLister) List() (ing extensions.IngressList, err error)

List lists all Ingress' in the store.

Jump to

Keyboard shortcuts

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