Documentation ¶
Overview ¶
Package virtualnode the node managed by aranya
Index ¶
- type CreationOptions
- type Manager
- func (m *Manager) Add(vn *VirtualNode) error
- func (m *Manager) All() map[string]*VirtualNode
- func (m *Manager) Delete(name string)
- func (m *Manager) Get(name string) (*VirtualNode, bool)
- func (m *Manager) OnVirtualNodeConnected(vn *VirtualNode) (allow bool)
- func (m *Manager) OnVirtualNodeDisconnected(vn *VirtualNode)
- func (m *Manager) Start(wg *sync.WaitGroup, stop <-chan struct{})
- type NodeCache
- func (n *NodeCache) RetrieveExtInfo() (extLabels, extAnnotations map[string]string)
- func (n *NodeCache) RetrieveStatus(s corev1.NodeStatus) corev1.NodeStatus
- func (n *NodeCache) UpdateCapacity(c corev1.ResourceList)
- func (n *NodeCache) UpdateConditions(c []corev1.NodeCondition)
- func (n *NodeCache) UpdateExtInfo(extInfo []*aranyagopb.NodeExtInfo) error
- func (n *NodeCache) UpdatePhase(p corev1.NodePhase)
- func (n *NodeCache) UpdateSystemInfo(i *corev1.NodeSystemInfo)
- type Options
- type VirtualNode
- func (vn *VirtualNode) ActualNodeStatus(resNodeStatus corev1.NodeStatus) corev1.NodeStatus
- func (vn *VirtualNode) Connected() bool
- func (vn *VirtualNode) ConnectivityServerListener() net.Listener
- func (vn *VirtualNode) ExtInfo() (labels, annotations map[string]string)
- func (vn *VirtualNode) ForceClose()
- func (vn *VirtualNode) KubeletServerListener() net.Listener
- func (vn *VirtualNode) OS() string
- func (vn *VirtualNode) SetPodCIDRs(ipv4, ipv6 string)
- func (vn *VirtualNode) Start() error
- func (vn *VirtualNode) SyncDeviceNodeStatus(action aranyagopb.NodeInfoGetCmd_Kind) error
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 ¶
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)
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 (*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) UpdateSystemInfo ¶
func (n *NodeCache) UpdateSystemInfo(i *corev1.NodeSystemInfo)
type Options ¶
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