virtualnode

package
v0.0.0-...-735b8cc Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package virtualnode the node managed by aranya

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreationOptions

type CreationOptions struct {
	// node info
	NodeName string
	HostIP   string
	Hostname string

	// func to schedule node status sync
	ScheduleNodeSync      func() error
	KubeClient            kubeclient.Interface
	KubeletServerListener net.Listener
	EventBroadcaster      record.EventBroadcaster
	VirtualnodeManager    *Manager

	ConnectivityManager connectivity.Manager

	ConnectivityOptions *connectivity.Options
	NodeOptions         *Options
	PodOptions          *pod.Options
	PeripheralOptions   *peripheral.Options
	MetricsOptions      *metrics.Options
	NetworkOptions      *network.Options
	StorageOptions      *storage.Options
}

CreationOptions are options used to create a new virtual node

type Manager

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

Manager of virtualnodes

func NewVirtualNodeManager

func NewVirtualNodeManager(
	ctx context.Context,
	config *conf.VN,
	getLease func(name string) *coordination.Lease,
	leaseClient *kubehelper.LeaseClient,
) *Manager

func (*Manager) Add

func (m *Manager) Add(vn *VirtualNode) error

Add a virtual node to the active virtual node list

func (*Manager) All

func (m *Manager) All() map[string]*VirtualNode

func (*Manager) Delete

func (m *Manager) Delete(name string)

Delete close and delete an active virtual node

func (*Manager) Get

func (m *Manager) Get(name string) (*VirtualNode, bool)

Get an active virtual node

func (*Manager) OnVirtualNodeConnected

func (m *Manager) OnVirtualNodeConnected(vn *VirtualNode) (allow bool)

func (*Manager) OnVirtualNodeDisconnected

func (m *Manager) OnVirtualNodeDisconnected(vn *VirtualNode)

func (*Manager) Start

func (m *Manager) Start(wg *sync.WaitGroup, stop <-chan struct{})

type NodeCache

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

NodeCache is a thread-safe cache store for node status and ext info (extra labels and annotations)

func (*NodeCache) RetrieveExtInfo

func (n *NodeCache) RetrieveExtInfo() (extLabels, extAnnotations map[string]string)

func (*NodeCache) RetrieveStatus

func (n *NodeCache) RetrieveStatus(s corev1.NodeStatus) corev1.NodeStatus

Retrieve latest node status cache

func (*NodeCache) UpdateCapacity

func (n *NodeCache) UpdateCapacity(c corev1.ResourceList)

func (*NodeCache) UpdateConditions

func (n *NodeCache) UpdateConditions(c []corev1.NodeCondition)

func (*NodeCache) UpdateExtInfo

func (n *NodeCache) UpdateExtInfo(extInfo []*aranyagopb.NodeExtInfo) error

func (*NodeCache) UpdatePhase

func (n *NodeCache) UpdatePhase(p corev1.NodePhase)

func (*NodeCache) UpdateSystemInfo

func (n *NodeCache) UpdateSystemInfo(i *corev1.NodeSystemInfo)

type Options

type Options struct {
	ForceSyncInterval      time.Duration
	MirrorNodeSyncInterval time.Duration

	NodeLabels      map[string]string
	NodeAnnotations map[string]string
}

type VirtualNode

type VirtualNode struct {
	SchedulePodJob pod.JobScheduleFunc
	// contains filtered or unexported fields
}

VirtualNode the virtual node implementation

func CreateVirtualNode

func CreateVirtualNode(ctx context.Context, cancel context.CancelFunc, opt *CreationOptions) (*VirtualNode, error)

CreateVirtualNode creates a new virtual node with options

func (*VirtualNode) ActualNodeStatus

func (vn *VirtualNode) ActualNodeStatus(resNodeStatus corev1.NodeStatus) corev1.NodeStatus

func (*VirtualNode) Connected

func (vn *VirtualNode) Connected() bool

func (*VirtualNode) ConnectivityServerListener

func (vn *VirtualNode) ConnectivityServerListener() net.Listener

func (*VirtualNode) ExtInfo

func (vn *VirtualNode) ExtInfo() (labels, annotations map[string]string)

func (*VirtualNode) ForceClose

func (vn *VirtualNode) ForceClose()

ForceClose shutdown this virtual node immediately

func (*VirtualNode) KubeletServerListener

func (vn *VirtualNode) KubeletServerListener() net.Listener

func (*VirtualNode) OS

func (vn *VirtualNode) OS() string

func (*VirtualNode) SetPodCIDRs

func (vn *VirtualNode) SetPodCIDRs(ipv4, ipv6 string)

func (*VirtualNode) Start

func (vn *VirtualNode) Start() error

Start the virtual node with all required managers

func (*VirtualNode) SyncDeviceNodeStatus

func (vn *VirtualNode) SyncDeviceNodeStatus(action aranyagopb.NodeInfoGetCmd_Kind) error

generate in cluster node cache for remote node

Directories

Path Synopsis
Package pod
Package pod
csi

Jump to

Keyboard shortcuts

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