provider

package
v0.3.2-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package provider contains methods implementing virtual-kubelet provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitConfig added in v0.3.1

type InitConfig struct {
	HomeConfig      *rest.Config
	HomeClusterID   string
	RemoteClusterID string
	Namespace       string

	NodeName             string
	LiqoIpamServer       string
	InformerResyncPeriod time.Duration

	ServiceWorkers       uint
	EndpointSliceWorkers uint
}

InitConfig is the config passed to initialize the LiqoPodProvider.

type LiqoProvider

type LiqoProvider struct {
	// contains filtered or unexported fields
}

LiqoProvider implements the virtual-kubelet provider interface and stores pods in memory.

func NewLiqoProvider

func NewLiqoProvider(ctx context.Context, cfg *InitConfig) (*LiqoProvider, error)

NewLiqoProvider creates a new NewLiqoProvider instance.

func (*LiqoProvider) CreatePod

func (p *LiqoProvider) CreatePod(ctx context.Context, homePod *corev1.Pod) error

CreatePod accepts a Pod definition and stores it in memory.

func (*LiqoProvider) DeletePod

func (p *LiqoProvider) DeletePod(ctx context.Context, pod *corev1.Pod) (err error)

DeletePod deletes the specified pod out of memory.

func (*LiqoProvider) GetContainerLogs

func (p *LiqoProvider) GetContainerLogs(ctx context.Context, homeNamespace, homePodName, containerName string,
	opts api.ContainerLogOpts) (io.ReadCloser, error)

GetContainerLogs retrieves the logs of a container by name from the provider.

func (*LiqoProvider) GetPod

func (p *LiqoProvider) GetPod(ctx context.Context, namespace, name string) (pod *corev1.Pod, err error)

GetPod returns a pod by name that is stored in memory.

func (*LiqoProvider) GetPodStatus

func (p *LiqoProvider) GetPodStatus(ctx context.Context, namespace, name string) (*corev1.PodStatus, error)

GetPodStatus is currently not implemented, panic if the method gets invoked. GetPodStatus should only be called by the virtual kubelet if the provider does not implement the PodNotifier interface. The LiqoProvider implements PodNotifier interface so we don't expect GetPodStatus to get called.

func (*LiqoProvider) GetPods

func (p *LiqoProvider) GetPods(ctx context.Context) ([]*corev1.Pod, error)

GetPods returns a list of all pods known to be "running".

func (*LiqoProvider) GetStatsSummary

func (p *LiqoProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)

GetStatsSummary returns dummy stats for all pods known by this provider.

func (*LiqoProvider) NotifyPods

func (p *LiqoProvider) NotifyPods(ctx context.Context, notifier func(*corev1.Pod))

NotifyPods is called to set a pod informing callback function. This should be called before any operations are ready within the provider.

func (*LiqoProvider) RunInContainer

func (p *LiqoProvider) RunInContainer(ctx context.Context, homeNamespace, homePodName, containerName string,
	cmd []string, attach api.AttachIO) error

RunInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.

func (*LiqoProvider) SetProviderStopper added in v0.3.0

func (p *LiqoProvider) SetProviderStopper(stopper chan struct{})

SetProviderStopper sets the provided chan as the stopper for the API reflector.

func (*LiqoProvider) UpdatePod

func (p *LiqoProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error

UpdatePod accepts a Pod definition and updates its reference.

Jump to

Keyboard shortcuts

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