pod_provider

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuntimeInfoStore

type RuntimeInfoStore struct {
	sync.RWMutex // This mutex is used for thread-safe access to the store.
	// contains filtered or unexported fields
}

RuntimeInfoStore provides in-memory runtime information.

func NewRuntimeInfoStore

func NewRuntimeInfoStore() *RuntimeInfoStore

func (*RuntimeInfoStore) CheckContainerStatusNeedSync added in v0.3.4

func (r *RuntimeInfoStore) CheckContainerStatusNeedSync(bizStatusData model.BizStatusData) bool

func (*RuntimeInfoStore) DeletePod

func (r *RuntimeInfoStore) DeletePod(podKey string, t tunnel.Tunnel)

DeletePod function removes a pod from the RuntimeInfoStore.

func (*RuntimeInfoStore) GetPodByKey

func (r *RuntimeInfoStore) GetPodByKey(podKey string) *corev1.Pod

GetPodByKey function retrieves a pod by its key.

func (*RuntimeInfoStore) GetPods

func (r *RuntimeInfoStore) GetPods() []*corev1.Pod

GetPods function retrieves all pods in the RuntimeInfoStore.

func (*RuntimeInfoStore) PutPod

func (r *RuntimeInfoStore) PutPod(pod *corev1.Pod, t tunnel.Tunnel)

PutPod function updates or adds a pod to the RuntimeInfoStore.

type VPodProvider

type VPodProvider struct {
	Namespace string
	// contains filtered or unexported fields
}

VPodProvider is a struct that implements the nodeutil.Provider and virtual_kubelet.PodNotifier interfaces

func NewVPodProvider

func NewVPodProvider(namespace, localIP, nodeID string, client client.Client, t tunnel.Tunnel) *VPodProvider

NewVPodProvider is a function that creates a new VPodProvider instance

func (*VPodProvider) CreatePod

func (b *VPodProvider) CreatePod(ctx context.Context, pod *corev1.Pod) error

CreatePod is a method of VPodProvider that creates a pod

func (*VPodProvider) DeletePod

func (b *VPodProvider) DeletePod(ctx context.Context, pod *corev1.Pod) error

DeletePod is a method of VPodProvider that deletes a pod

func (*VPodProvider) GetPod

func (b *VPodProvider) GetPod(_ context.Context, namespace, name string) (*corev1.Pod, error)

GetPod is a method of VPodProvider that gets a pod This method is simply used to return the observed defaultPod by local

so the outer control loop can call CreatePod / UpdatePod / DeletePod accordingly
just return the defaultPod from the local store

func (*VPodProvider) GetPodStatus

func (b *VPodProvider) GetPodStatus(ctx context.Context, pod *corev1.Pod, bizStatus model.BizStatusData) (*corev1.PodStatus, error)

GetPodStatus is a method of VPodProvider that gets the status of a pod This will be called repeatedly by virtual kubelet framework to get the defaultPod status we should query the actual runtime info and convert them in to V1PodStatus accordingly

func (*VPodProvider) GetPods

func (b *VPodProvider) GetPods(_ context.Context) ([]*corev1.Pod, error)

func (*VPodProvider) NotifyPods

func (b *VPodProvider) NotifyPods(_ context.Context, cb func(*corev1.Pod))

NotifyPods is a method of VPodProvider that sets the notify function

func (*VPodProvider) SyncAllContainerInfo added in v0.3.1

func (b *VPodProvider) SyncAllContainerInfo(ctx context.Context, bizStatusDatas []model.BizStatusData)

SyncAllContainerInfo is a method of VPodProvider that synchronizes the information of all containers

func (*VPodProvider) SyncOneContainerInfo added in v0.3.1

func (b *VPodProvider) SyncOneContainerInfo(ctx context.Context, bizStatusData model.BizStatusData)

SyncOneContainerInfo is a method of VPodProvider that synchronizes the information of a single container

func (*VPodProvider) UpdatePod

func (b *VPodProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error

UpdatePod is a method of VPodProvider that updates a pod

Jump to

Keyboard shortcuts

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