pod_provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProvider

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

func NewBaseProvider

func NewBaseProvider(namespace, localIP, nodeID string, k8sClient kubernetes.Interface, t tunnel.Tunnel) *BaseProvider

func (*BaseProvider) CreatePod

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

CreatePod directly install a biz bundle to base

func (*BaseProvider) DeletePod

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

DeletePod directly uninstall biz from base

func (*BaseProvider) GetPod

func (b *BaseProvider) 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 (*BaseProvider) GetPodStatus

func (b *BaseProvider) 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 (*BaseProvider) GetPods

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

func (*BaseProvider) NotifyPods

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

func (*BaseProvider) Run

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

func (*BaseProvider) SyncBizInfo

func (b *BaseProvider) SyncBizInfo(bizInfos []ark.ArkBizInfo)

func (*BaseProvider) UpdatePod

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

UpdatePod install directly

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) DeletePod

func (r *RuntimeInfoStore) DeletePod(podKey string)

func (*RuntimeInfoStore) GetBizModel

func (r *RuntimeInfoStore) GetBizModel(bizIdentity string) *ark.BizModel

func (*RuntimeInfoStore) GetPodByKey

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

func (*RuntimeInfoStore) GetPods

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

func (*RuntimeInfoStore) GetRelatedBizModels

func (r *RuntimeInfoStore) GetRelatedBizModels(podKey string) []*ark.BizModel

func (*RuntimeInfoStore) GetRelatedPodKeyByBizIdentity

func (r *RuntimeInfoStore) GetRelatedPodKeyByBizIdentity(bizIdentity string) string

func (*RuntimeInfoStore) PutPod

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

Jump to

Keyboard shortcuts

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