watchers

package
v0.0.0-...-030b38e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexIPToEndpoint    = "ipToEndpoint"
	IndexIPToENI         = "ipToENI"
	IndexInstanceIDToNRS = "instanceIDToNRS"
)
View Source
const (
	CCENetworkUnavailable corev1.NodeConditionType = "CCENetworkUnavailable"
)
View Source
const PodNodeNameIndex = "pod-node"

Variables

View Source
var (
	// PodStore has a minimal copy of all pods running in the cluster.
	// Warning: The pods stored in the cache are not intended to be used for Update
	// operations in k8s as some of its fields are not populated.
	PodStore cache.Store

	// PodClient cache client to use pod updater
	PodClient = &PodUpdater{}
)
View Source
var CCEEndpointClient = &CCEEndpointUpdaterImpl{}
View Source
var CCESubnetClient = &subnetUpdaterImpl{}
View Source
var ENIClient = &eniUpdaterImpl{}
View Source
var (
	NetResourceSetClient = &NetResourceSetUpdateImplementation{}
)
View Source
var (
	NodeClient = &NodeUpdater{}
)
View Source
var SecurityGroupClient = &sgUpdaterImpl{}

Functions

func HandleNodeTolerationAndTaints

func HandleNodeTolerationAndTaints(stopCh <-chan struct{})

HandleNodeTolerationAndTaints remove node

func HasCCEIsUpCondition

func HasCCEIsUpCondition(n *corev1.Node, reason string, status corev1.ConditionStatus) bool

HasCCEIsUpCondition returns true if the given k8s node has the cce node condition set. warning: we cannot judge the reason why the node is not ready, because many external network plug-ins, such as Cilium, also modify this field

func RunNetResourceSetGC

func RunNetResourceSetGC(ctx context.Context, interval time.Duration)

RunNetResourceSetGC performs garbage collector for cce node resource

func StartSynchronizingCCEEndpoint

func StartSynchronizingCCEEndpoint(ctx context.Context, endpointManager EndpointEventHandler) error

func StartSynchronizingCPSTS

func StartSynchronizingCPSTS(ctx context.Context) error

func StartSynchronizingENI

func StartSynchronizingENI(ctx context.Context, eniManager syncer.ENIEventHandler) error

func StartSynchronizingNetResourceSets

func StartSynchronizingNetResourceSets(ctx context.Context, nodeManager NodeEventHandler) error

func StartSynchronizingPSTS

func StartSynchronizingPSTS(ctx context.Context) error

func StartSynchronizingSecurityGroup

func StartSynchronizingSecurityGroup(ctx context.Context, sgManager syncer.SecurityGroupEventHandler) error

func StartSynchronizingSubnet

func StartSynchronizingSubnet(ctx context.Context, subnetManager syncer.SubnetEventHandler) error

func StartWatchers

func StartWatchers(stopCh <-chan struct{})

func WaitForCacheSync

func WaitForCacheSync(stopCh <-chan struct{})

Types

type CCEEndpointUpdaterImpl

type CCEEndpointUpdaterImpl struct {
}

func (*CCEEndpointUpdaterImpl) Create

func (*CCEEndpointUpdaterImpl) Delete

func (c *CCEEndpointUpdaterImpl) Delete(namespace, name string) error

func (*CCEEndpointUpdaterImpl) GetByIP

func (c *CCEEndpointUpdaterImpl) GetByIP(ip string) ([]*ccev2.CCEEndpoint, error)

GetByIP get CCEEndpoint by ip

func (*CCEEndpointUpdaterImpl) Lister

func (*CCEEndpointUpdaterImpl) Update

func (c *CCEEndpointUpdaterImpl) Update(newResource *ccev2.CCEEndpoint) (*ccev2.CCEEndpoint, error)

func (*CCEEndpointUpdaterImpl) UpdateStatus

func (c *CCEEndpointUpdaterImpl) UpdateStatus(newResource *ccev2.CCEEndpoint) (*ccev2.CCEEndpoint, error)

type CPSTSEventHandler

type CPSTSEventHandler interface {
	Update(resource *ccev2alpha1.ClusterPodSubnetTopologySpread) error
	Delete(namespace, pstsName string) error
}

CPSTSEventHandler should implement the behavior to handle PSTS

type ENIUpdater

type ENIUpdater interface {
	Lister() ccev2lister.ENILister
	Create(eni *ccev2.ENI) (*ccev2.ENI, error)
	Update(newResource *ccev2.ENI) (*ccev2.ENI, error)
	Delete(name string) error
	UpdateStatus(newResource *ccev2.ENI) (*ccev2.ENI, error)
	GetByIP(ip string) ([]*ccev2.ENI, error)
}

type EndpointEventHandler

type EndpointEventHandler interface {
	Create(resource *ccev2.CCEEndpoint) error
	Update(resource *ccev2.CCEEndpoint) error
	Delete(namespace, endpointName string) error
	Resync(context.Context) error
}

EndpointEventHandler should implement the behavior to handle CCEEndpoint

type NetResourceSetUpdateImplementation

type NetResourceSetUpdateImplementation struct{}

func (*NetResourceSetUpdateImplementation) Create

func (*NetResourceSetUpdateImplementation) Get

func (*NetResourceSetUpdateImplementation) GetByInstanceID

func (c *NetResourceSetUpdateImplementation) GetByInstanceID(instanceID string) ([]*ccev2.NetResourceSet, error)

GetByIP get CCEEndpoint by ip

func (*NetResourceSetUpdateImplementation) Lister

func (*NetResourceSetUpdateImplementation) Update

func (*NetResourceSetUpdateImplementation) UpdateStatus

type NodeEventHandler

type NodeEventHandler interface {
	Create(resource *ccev2.NetResourceSet) error
	Update(resource *ccev2.NetResourceSet) error
	Delete(nodeName string) error
	Resync(context.Context, time.Time)
	ResourceType() string
}

NodeEventHandler should implement the behavior to handle NetResourceSet

type NodeUpdater

type NodeUpdater struct {
}

func (*NodeUpdater) Lister

func (*NodeUpdater) Lister() listv1.NodeLister

func (*NodeUpdater) NodeInterface

func (*NodeUpdater) NodeInterface() typev1.NodeInterface

type PSTSEventHandler

type PSTSEventHandler interface {
	Update(resource *ccev2.PodSubnetTopologySpread) error
	Delete(namespace, pstsName string) error
}

PSTSEventHandler should implement the behavior to handle PSTS

type PodUpdater

type PodUpdater struct {
}

func (*PodUpdater) Lister

func (*PodUpdater) Lister() listv1.PodLister

func (*PodUpdater) PodInterface

func (*PodUpdater) PodInterface(namespace string) typev1.PodInterface

Jump to

Keyboard shortcuts

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