cloud-providerk8s.io/cloud-provider/controllers/service Index | Files | Directories

package service

import "k8s.io/cloud-provider/controllers/service"

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

Index

Constants

const (

	// ToBeDeletedTaint is a taint used by the CLuster Autoscaler before marking a node for deletion. Defined in
	// https://github.com/kubernetes/autoscaler/blob/e80ab518340f88f364fe3ef063f8303755125971/cluster-autoscaler/utils/deletetaint/delete.go#L36
	ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler"
)

Types

type Controller

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

Controller 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,
	featureGate featuregate.FeatureGate,
) (*Controller, error)

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

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, workers int, controllerManagerMetrics *controllersmetrics.ControllerManagerMetrics)

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.

type NodeConditionPredicate

type NodeConditionPredicate func(node *v1.Node) bool

NodeConditionPredicate is a function that indicates whether the given node's conditions meet some set of criteria defined by the function.

Source Files

controller.go doc.go metrics.go

Directories

PathSynopsis
controllers/service/config
controllers/service/config/v1alpha1
Version
v0.32.2 (latest)
Published
Feb 13, 2025
Platform
linux/amd64
Imports
28 packages
Last checked
3 months ago

Tools for package owners.