provider

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 36 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 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, nodeName, foreignClusterID, homeClusterID, internalIP string, daemonEndpointPort int32,
	kubeconfig string, informerResyncPeriod time.Duration, ipamGRPCServer string) (*LiqoProvider, error)

NewLiqoProvider creates a new NewLiqoProvider instance.

func (*LiqoProvider) ConfigureNode

func (p *LiqoProvider) ConfigureNode(ctx context.Context, n *v1.Node)

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) GetNetworkReadyChan added in v0.3.0

func (p *LiqoProvider) GetNetworkReadyChan() chan struct{}

GetNetworkReadyChan reetrun the chan where to notify that the network connectivity has been established.

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