pod_provider

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 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
	// contains filtered or unexported fields
}

RuntimeInfoStore provide the in memory runtime information.

func NewRuntimeInfoStore

func NewRuntimeInfoStore() *RuntimeInfoStore

func (*RuntimeInfoStore) DeleteContainer

func (r *RuntimeInfoStore) DeleteContainer(containerKey string)

func (*RuntimeInfoStore) DeletePod

func (r *RuntimeInfoStore) DeletePod(podKey string)

func (*RuntimeInfoStore) GetContainer

func (r *RuntimeInfoStore) GetContainer(containerKey string) *corev1.Container

func (*RuntimeInfoStore) GetLatestContainerInfoByContainerKey

func (r *RuntimeInfoStore) GetLatestContainerInfoByContainerKey(containerKey string) *model.ContainerStatusData

func (*RuntimeInfoStore) GetLatestContainerInfos

func (r *RuntimeInfoStore) GetLatestContainerInfos() []*model.ContainerStatusData

func (*RuntimeInfoStore) GetPodByKey

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

func (*RuntimeInfoStore) GetPods

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

func (*RuntimeInfoStore) GetRelatedPodKeysByContainerName

func (r *RuntimeInfoStore) GetRelatedPodKeysByContainerName(containerName string) []string

func (*RuntimeInfoStore) PutContainerInfo

func (r *RuntimeInfoStore) PutContainerInfo(containerInfo model.ContainerStatusData)

func (*RuntimeInfoStore) PutPod

func (r *RuntimeInfoStore) PutPod(pod *corev1.Pod)

func (*RuntimeInfoStore) SyncContainerInfo

func (r *RuntimeInfoStore) SyncContainerInfo(containerInfos []model.ContainerStatusData)

type VPodProvider

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

func NewVPodProvider

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

func (*VPodProvider) CreatePod

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

func (*VPodProvider) DeletePod

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

func (*VPodProvider) GetPod

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

GetPod 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, namespace, name string) (*corev1.PodStatus, error)

GetPodStatus this will be called repeatedly by virtual kubelet framework to get the defaultPod status we should query the actual runtime info and translate 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))

func (*VPodProvider) Run

func (b *VPodProvider) Run(ctx context.Context)

func (*VPodProvider) SyncContainerInfo

func (b *VPodProvider) SyncContainerInfo(ctx context.Context, containerInfos []model.ContainerStatusData)

func (*VPodProvider) SyncSingleContainerInfo

func (b *VPodProvider) SyncSingleContainerInfo(ctx context.Context, info model.ContainerStatusData)

func (*VPodProvider) UpdatePod

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

Jump to

Keyboard shortcuts

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