service

package
v0.0.0-...-6b9ae1e Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//SERVICE_SYNC_PERIOD Interval of synchronizing service status from apiserver
	SERVICE_SYNC_PERIOD = 1 * time.Minute
	SERVICE_QUEUE       = "service-queue"
	NODE_QUEUE          = "node-queue"
	SERVICE_CONTROLLER  = "service-controller"

	LabelNodeRoleMaster = "node-role.kubernetes.io/master"

	// LabelNodeRoleExcludeBalancer specifies that the node should be
	// exclude from load balancers created by a cloud provider.
	LabelNodeRoleExcludeBalancer = "alpha.service-controller.kubernetes.io/exclude-balancer"
	CCM_CLASS                    = "service.beta.kubernetes.io/class"
)
View Source
const TRY_AGAIN = "try again"

Variables

This section is empty.

Functions

func AvailableNodeModeLocal

func AvailableNodeModeLocal(nodes []*v1.Node, svc *v1.Service,
	ifactory informers.SharedInformerFactory) ([]*v1.Node, error)

func AvailableNodes

func AvailableNodes(
	svc *v1.Service,
	ifactory informers.SharedInformerFactory,
) ([]*v1.Node, error)

func Enqueue

func Enqueue(queue queue.DelayingInterface, k interface{})

func IsENIBackendType

func IsENIBackendType(svc *v1.Service) bool

func NeedLoadBalancer

func NeedLoadBalancer(service *v1.Service) bool

func NeedUpdate

func NeedUpdate(old, newm *v1.Service, record record.EventRecorder) bool

NeedUpdate compare old and new service for possible changes

func NodeConditionChanged

func NodeConditionChanged(a, b []v1.NodeCondition) bool

func NodeConditionPredicate

func NodeConditionPredicate(svc *v1.Service) (corelisters.NodeConditionPredicate, error)

func NodeLabelsChanged

func NodeLabelsChanged(a, b map[string]string) bool

func NodeSpecChanged

func NodeSpecChanged(a, b *v1.Node) bool

func ServiceModeLocal

func ServiceModeLocal(svc *v1.Service) bool

func WorkerFunc

func WorkerFunc(
	contex *Context,
	queue queue.DelayingInterface,
	syncd SyncTask,
) func()

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) Get

func (c *Context) Get(name string) *v1.Service

func (*Context) Range

func (c *Context) Range(f func(key string, value *v1.Service) bool)

func (*Context) Remove

func (c *Context) Remove(name string)

func (*Context) Set

func (c *Context) Set(name string, val *v1.Service)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	cloud cloudprovider.LoadBalancer,
	client clientset.Interface,
	ifactory informers.SharedInformerFactory,
	clusterName string,
) (*Controller, error)

func (*Controller) HandlerForEndpointChange

func (con *Controller) HandlerForEndpointChange(
	context *Context,
	que queue.DelayingInterface,
	informer cache.SharedIndexInformer,
)

func (*Controller) HandlerForNodesChange

func (con *Controller) HandlerForNodesChange(
	ctx *Context,
	que queue.DelayingInterface,
	informer cache.SharedIndexInformer,
)

func (*Controller) HandlerForServiceChange

func (con *Controller) HandlerForServiceChange(
	context *Context,
	que queue.DelayingInterface,
	informer cache.SharedIndexInformer,
	record record.EventRecorder,
)

func (*Controller) NodeSyncTask

func (con *Controller) NodeSyncTask(k string) error

func (*Controller) Run

func (con *Controller) Run(stopCh <-chan struct{}, workers int)

func (*Controller) ServiceSyncTask

func (con *Controller) ServiceSyncTask(k string) error

SyncService Entrance for syncing service

type EnsureENI

type EnsureENI interface {
	// EnsureLoadbalancerWithENI
	// creates a new load balancer 'name', or updates the existing one. Returns the
	// status of the balancer. Implementations must treat the *v1.svc and *v1.Endpoints
	// parameters as read-only and not modify them.
	// Parameter 'name' is the name of the cluster as presented to kube-controller-manager
	EnsureLoadBalancerWithENI(name string, svc *v1.Service, endpoint *v1.Endpoints) (*v1.LoadBalancerStatus, error)

	// UpdateLoadBalancerWithENI updates hosts under the specified load balancer.
	// Implementations must treat the *v1.Service and *v1.Enodpoints
	// parameters as read-only and not modify them.
	// Parameter 'name' is the name of the cluster as presented to kube-controller-manager
	UpdateLoadBalancerWithENI(name string, service *v1.Service, endpoint *v1.Endpoints) error
}

type SyncTask

type SyncTask func(key string) error

Jump to

Keyboard shortcuts

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