vnode

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VNode

type VNode struct {
	tunnel.Tunnel // Tunnel for communication with the virtual kubelet
	// contains filtered or unexported fields
}

VNode is the main struct for a virtual node

func NewVNode

func NewVNode(config *model.BuildVNodeConfig, t tunnel.Tunnel) (kn *VNode, err error)

NewVNode creates a new virtual node

func (*VNode) CheckAndUpdatePod

func (n *VNode) CheckAndUpdatePod(ctx context.Context, key string, obj interface{}, pod *corev1.Pod)

CheckAndUpdatePod checks and updates a pod in the node

func (*VNode) CreateNodeLease added in v0.3.0

func (n *VNode) CreateNodeLease(ctx context.Context, controllerID string) bool

CreateNodeLease creates a new lease for the node

func (*VNode) DeletePod

func (n *VNode) DeletePod(key string)

DeletePod deletes a pod from the node

func (*VNode) DeletePodsFromKubernetesForget

func (n *VNode) DeletePodsFromKubernetesForget(ctx context.Context, key string)

DeletePodsFromKubernetesForget deletes pods from Kubernetes in the node

func (*VNode) Done

func (n *VNode) Done() <-chan struct{}

Done returns a channel that will be closed when the vnode has exited.

func (*VNode) Err

func (n *VNode) Err() error

Err returns err which causes vnode exit

func (*VNode) ExitWhenLeaderChanged added in v0.3.0

func (n *VNode) ExitWhenLeaderChanged() <-chan struct{}

ExitWhenLeaderChanged returns a channel that will be closed when the vnode leader changed

func (*VNode) IsLeader added in v0.3.0

func (n *VNode) IsLeader() bool

IsLeader returns a bool marked current vnode is leader or not

func (*VNode) ListPodFromController added in v0.3.4

func (n *VNode) ListPodFromController() ([]*corev1.Pod, bool)

ListPodFromController list all pods for this node from the kubernetes

func (*VNode) LoadPodFromController

func (n *VNode) LoadPodFromController(key string) (any, bool)

LoadPodFromController loads a pod from the node's pod controller

func (*VNode) LockRetryLease added in v0.3.0

func (n *VNode) LockRetryLease()

LockRetryLease locks the vnode to retry the lease

func (*VNode) PodStore

func (n *VNode) PodStore(key string, pod *corev1.Pod)

PodStore stores the pod in the node

func (*VNode) RenewLease added in v0.3.0

func (n *VNode) RenewLease(ctx context.Context, clientID string)

RenewLease renews the lease of the node

func (*VNode) RetryLease added in v0.3.0

func (n *VNode) RetryLease()

RetryLease signals the vnode to retry the lease

func (*VNode) Run

func (n *VNode) Run(ctx context.Context, initData model.NodeInfo)

Run is the main function for a virtual node

func (*VNode) ShouldRetryLease added in v0.3.0

func (n *VNode) ShouldRetryLease() <-chan struct{}

ShouldRetryLease returns a channel that will be closed when the vnode should retry lease

func (*VNode) Shutdown

func (n *VNode) Shutdown()

Shutdown is the func of shutting down a vnode when base exit

func (*VNode) SyncAllContainerInfo

func (n *VNode) SyncAllContainerInfo(ctx context.Context, infos []model.BizStatusData)

SyncAllContainerInfo syncs the status of all containers

func (*VNode) SyncNodeStatus

func (n *VNode) SyncNodeStatus(data model.NodeStatusData)

SyncNodeStatus syncs the status of the node

func (*VNode) SyncOneContainerInfo added in v0.3.1

func (n *VNode) SyncOneContainerInfo(ctx context.Context, bizStatusData model.BizStatusData)

SyncOneContainerInfo syncs the status of a single container

func (*VNode) SyncPodsFromKubernetesEnqueue

func (n *VNode) SyncPodsFromKubernetesEnqueue(ctx context.Context, key string)

SyncPodsFromKubernetesEnqueue syncs pods from Kubernetes to the node

func (*VNode) WaitReady

func (n *VNode) WaitReady(ctx context.Context, timeout time.Duration) error

WaitReady waits for the node to be ready

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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