Documentation ¶
Overview ¶
Package provider contains methods implementing virtual-kubelet provider
Index ¶
- type InitConfig
- type LiqoProvider
- func (p *LiqoProvider) CreatePod(ctx context.Context, homePod *corev1.Pod) error
- func (p *LiqoProvider) DeletePod(ctx context.Context, pod *corev1.Pod) (err error)
- func (p *LiqoProvider) GetContainerLogs(ctx context.Context, homeNamespace, homePodName, containerName string, ...) (io.ReadCloser, error)
- func (p *LiqoProvider) GetPod(ctx context.Context, namespace, name string) (pod *corev1.Pod, err error)
- func (p *LiqoProvider) GetPodStatus(ctx context.Context, namespace, name string) (*corev1.PodStatus, error)
- func (p *LiqoProvider) GetPods(ctx context.Context) ([]*corev1.Pod, error)
- func (p *LiqoProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)
- func (p *LiqoProvider) NotifyPods(ctx context.Context, notifier func(*corev1.Pod))
- func (p *LiqoProvider) RunInContainer(ctx context.Context, homeNamespace, homePodName, containerName string, ...) error
- func (p *LiqoProvider) SetProviderStopper(stopper chan struct{})
- func (p *LiqoProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error
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) 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) GetStatsSummary ¶
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.