kubernetesk8s.io/kubernetes/pkg/controller/service Index | Files

package service

import "k8s.io/kubernetes/pkg/controller/service"

Package service contains code for syncing cloud load balancers with the service registry.

Index

Constants

const (

	// LabelNodeRoleMaster specifies that a node is a master
	// It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112
	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"
)

Types

type ServiceController

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

ServiceController keeps cloud provider service resources (like load balancers) in sync with the registry.

func New

func New(
	cloud cloudprovider.Interface,
	kubeClient clientset.Interface,
	serviceInformer coreinformers.ServiceInformer,
	nodeInformer coreinformers.NodeInformer,
	clusterName string,
) (*ServiceController, error)

New returns a new service controller to keep cloud provider service resources (like load balancers) in sync with the registry.

func (*ServiceController) Run

func (s *ServiceController) Run(stopCh <-chan struct{}, workers int)

Run starts a background goroutine that watches for changes to services that have (or had) LoadBalancers=true and ensures that they have load balancers created and deleted appropriately. serviceSyncPeriod controls how often we check the cluster's services to ensure that the correct load balancers exist. nodeSyncPeriod controls how often we check the cluster's nodes to determine if load balancers need to be updated to point to a new set.

It's an error to call Run() more than once for a given ServiceController object.

Source Files

doc.go service_controller.go

Version
v1.13.0-alpha.2
Published
Oct 24, 2018
Platform
js/wasm
Imports
25 packages
Last checked
1 minute ago

Tools for package owners.