sync

package
v1.13.5-k3s.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// InvalidPodCIDR is the event recorded when a node is found with an
	// invalid PodCIDR.
	InvalidPodCIDR = "CloudCIDRAllocatorInvalidPodCIDR"
	// InvalidModeEvent is the event recorded when the CIDR range cannot be
	// sync'd due to the cluster running in the wrong mode.
	InvalidModeEvent = "CloudCIDRAllocatorInvalidMode"
	// MismatchEvent is the event recorded when the CIDR range allocated in the
	// node spec does not match what has been allocated in the cloud.
	MismatchEvent = "CloudCIDRAllocatorMismatch"
)

Variables

This section is empty.

Functions

func IsValidMode

func IsValidMode(m NodeSyncMode) bool

IsValidMode returns true if the given mode is valid.

Types

type NodeSync

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

NodeSync synchronizes the state for a single node in the cluster.

func New

func New(c controller, cloudAlias cloudAlias, kubeAPI kubeAPI, mode NodeSyncMode, nodeName string, set *cidrset.CidrSet) *NodeSync

New returns a new syncer for a given node.

func (*NodeSync) Delete

func (sync *NodeSync) Delete(node *v1.Node)

Delete performs the sync operations necessary to remove the node from the IPAM state.

This method is safe to call from multiple goroutines.

func (*NodeSync) Loop

func (sync *NodeSync) Loop(done chan struct{})

Loop runs the sync loop for a given node. done is an optional channel that is closed when the Loop() returns.

func (*NodeSync) Update

func (sync *NodeSync) Update(node *v1.Node)

Update causes an update operation on the given node. If node is nil, then the syncer will fetch the node spec from the API server before syncing.

This method is safe to call from multiple goroutines.

type NodeSyncMode

type NodeSyncMode string

NodeSyncMode is the mode the cloud CIDR allocator runs in.

var (
	// SyncFromCloud is the mode that synchronizes the IP allocation from the cloud
	// platform to the node.
	SyncFromCloud NodeSyncMode = "SyncFromCloud"
	// SyncFromCluster is the mode that synchronizes the IP allocation determined
	// by the k8s controller to the cloud provider.
	SyncFromCluster NodeSyncMode = "SyncFromCluster"
)

Jump to

Keyboard shortcuts

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