context

package
v1.36.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 37 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// Frequency to poll on local stores to sync.
	StoreSyncPollPeriod = 5 * time.Second

	ClusterTypeZonal    = "ZONAL"
	ClusterTypeRegional = "REGIONAL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerContext

type ControllerContext struct {
	KubeClient          kubernetes.Interface
	SvcNegClient        svcnegclient.Interface
	SAClient            serviceattachmentclient.Interface
	FirewallClient      firewallclient.Interface
	EventRecorderClient kubernetes.Interface
	NodeTopologyClient  nodetopologyclient.Interface

	Cloud *gce.Cloud

	ClusterNamer  *namer.Namer
	KubeSystemUID types.UID
	L4Namer       namer.L4ResourcesNamer

	ControllerContextConfig

	IngressInformer          cache.SharedIndexInformer
	ServiceInformer          cache.SharedIndexInformer
	BackendConfigInformer    cache.SharedIndexInformer
	FrontendConfigInformer   cache.SharedIndexInformer
	PodInformer              cache.SharedIndexInformer
	NodeInformer             cache.SharedIndexInformer
	EndpointSliceInformer    cache.SharedIndexInformer
	ConfigMapInformer        cache.SharedIndexInformer
	SvcNegInformer           cache.SharedIndexInformer
	SAInformer               cache.SharedIndexInformer
	FirewallInformer         cache.SharedIndexInformer
	NetworkInformer          cache.SharedIndexInformer
	GKENetworkParamsInformer cache.SharedIndexInformer
	NodeTopologyInformer     cache.SharedIndexInformer

	ControllerMetrics *metrics.ControllerMetrics

	// NOTE: If the flag GKEClusterType is empty, then cluster will default to zonal. This field should not be used for
	// controller logic and should only be used for providing additional information to the user.
	RegionalCluster bool

	InstancePool instancegroups.Manager
	Translator   *translator.Translator
	ZoneGetter   *zonegetter.ZoneGetter
	// contains filtered or unexported fields
}

ControllerContext holds the state needed for the execution of the controller.

func NewControllerContext

func NewControllerContext(
	kubeClient kubernetes.Interface,
	backendConfigClient backendconfigclient.Interface,
	frontendConfigClient frontendconfigclient.Interface,
	firewallClient firewallclient.Interface,
	svcnegClient svcnegclient.Interface,
	saClient serviceattachmentclient.Interface,
	networkClient networkclient.Interface,
	nodeTopologyClient nodetopologyclient.Interface,
	eventRecorderClient kubernetes.Interface,
	cloud *gce.Cloud,
	clusterNamer *namer.Namer,
	kubeSystemUID types.UID,
	config ControllerContextConfig,
	logger klog.Logger,
) (*ControllerContext, error)

NewControllerContext returns a new shared set of informers.

func (*ControllerContext) BackendConfigs added in v1.5.0

func (ctx *ControllerContext) BackendConfigs() *typed.BackendConfigStore

BackendConfigs returns the store of BackendConfigs.

func (*ControllerContext) FrontendConfigs added in v1.6.0

func (ctx *ControllerContext) FrontendConfigs() *typed.FrontendConfigStore

FrontendConfigs returns the store of FrontendConfigs.

func (*ControllerContext) HasSynced

func (ctx *ControllerContext) HasSynced() bool

HasSynced returns true if all relevant informers has been synced.

func (*ControllerContext) Ingresses added in v1.5.0

func (ctx *ControllerContext) Ingresses() *typed.IngressStore

Ingresses returns the store of Ingresses.

func (*ControllerContext) Recorder

func (ctx *ControllerContext) Recorder(ns string) record.EventRecorder

func (*ControllerContext) Services added in v1.5.0

func (ctx *ControllerContext) Services() *typed.ServiceStore

Services returns the store of Services.

func (*ControllerContext) Start

func (ctx *ControllerContext) Start(stopCh <-chan struct{})

Start all of the informers.

type ControllerContextConfig added in v1.3.0

type ControllerContextConfig struct {
	Namespace         string
	ResyncPeriod      time.Duration
	NumL4Workers      int
	NumL4NetLBWorkers int
	// DefaultBackendSvcPortID is the ServicePort for the system default backend.
	DefaultBackendSvcPort                     utils.ServicePort
	HealthCheckPath                           string
	FrontendConfigEnabled                     bool
	MaxIGSize                                 int
	EnableL4ILBDualStack                      bool
	EnableL4NetLBDualStack                    bool
	EnableL4StrongSessionAffinity             bool
	EnableMultinetworking                     bool
	EnableIngressRegionalExternal             bool
	EnableWeightedL4ILB                       bool
	EnableWeightedL4NetLB                     bool
	EnableL4ILBZonalAffinity                  bool
	DisableL4LBFirewall                       bool
	EnableL4NetLBNEGs                         bool
	EnableL4NetLBNEGsDefault                  bool
	EnableL4ILBMixedProtocol                  bool
	EnableL4NetLBMixedProtocol                bool
	EnableL4NetLBForwardingRulesOptimizations bool
}

ControllerContextConfig encapsulates some settings that are tunable via command line flags.

Jump to

Keyboard shortcuts

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