virtual-kubelet: github.com/virtual-kubelet/virtual-kubelet/cmd/virtual-kubelet/internal/provider Index | Files | Directories

package provider

import "github.com/virtual-kubelet/virtual-kubelet/cmd/virtual-kubelet/internal/provider"

Index

Package Files

provider.go store.go types.go

Constants

const (
    // OperatingSystemLinux is the configuration value for defining Linux.
    OperatingSystemLinux = "Linux"
    // OperatingSystemWindows is the configuration value for defining Windows.
    OperatingSystemWindows = "Windows"
)

Variables

var (
    // ValidOperatingSystems defines the group of operating systems
    // that can be used as a kubelet node.
    ValidOperatingSystems = OperatingSystems{
        OperatingSystemLinux:   true,
        OperatingSystemWindows: true,
    }
)

type InitConfig Uses

type InitConfig struct {
    ConfigPath        string
    NodeName          string
    OperatingSystem   string
    InternalIP        string
    DaemonPort        int32
    KubeClusterDomain string
    ResourceManager   *manager.ResourceManager
}

InitConfig is the config passed to initialize a registered provider.

type InitFunc Uses

type InitFunc func(InitConfig) (Provider, error)

type OperatingSystems Uses

type OperatingSystems map[string]bool

func (OperatingSystems) Names Uses

func (o OperatingSystems) Names() []string

type PodMetricsProvider Uses

type PodMetricsProvider interface {
    GetStatsSummary(context.Context) (*stats.Summary, error)
}

PodMetricsProvider is an optional interface that providers can implement to expose pod stats

type Provider Uses

type Provider interface {
    node.PodLifecycleHandler

    // GetContainerLogs retrieves the logs of a container by name from the provider.
    GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)

    // RunInContainer executes a command in a container in the pod, copying data
    // between in/out/err and the container's stdin/stdout/stderr.
    RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, attach api.AttachIO) error

    // ConfigureNode enables a provider to configure the node object that
    // will be used for Kubernetes.
    ConfigureNode(context.Context, *v1.Node)
}

Provider contains the methods required to implement a virtual-kubelet provider.

Errors produced by these methods should implement an interface from github.com/virtual-kubelet/virtual-kubelet/errdefs package in order for the core logic to be able to understand the type of failure.

type Store Uses

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

Store is used for registering/fetching providers

func NewStore Uses

func NewStore() *Store

func (*Store) Exists Uses

func (s *Store) Exists(name string) bool

Exists returns if there is an init function registered under the provided name

func (*Store) Get Uses

func (s *Store) Get(name string) InitFunc

Get gets the registered init func for the given name The returned function may be nil if the given name is not registered.

func (*Store) List Uses

func (s *Store) List() []string

List lists all the registered providers

func (*Store) Register Uses

func (s *Store) Register(name string, f InitFunc) error

Register registers a providers init func by name

Directories

PathSynopsis
mock

Package provider imports 9 packages (graph) and is imported by 3 packages. Updated 2019-09-05. Refresh now. Tools for package owners.