Documentation
¶
Index ¶
- type Config
- type Provider
- type ProviderV0
- func (p *ProviderV0) ConfigureNode(ctx context.Context, n *v1.Node)
- func (p *ProviderV0) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *ProviderV0) DeletePod(ctx context.Context, pod *v1.Pod) (err error)
- func (p *ProviderV0) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *ProviderV0) GetPod(ctx context.Context, namespace, name string) (pod *v1.Pod, err error)
- func (p *ProviderV0) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *ProviderV0) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *ProviderV0) GetStatsSummary(ctx context.Context) (*statsv1alpha1.Summary, error)
- func (p *ProviderV0) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, ...) error
- func (p *ProviderV0) UpdatePod(ctx context.Context, pod *v1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { CPU string `json:"cpu,omitempty"` Memory string `json:"memory,omitempty"` Pods string `json:"pods,omitempty"` }
Config contains a mock virtual-kubelet's configurable parameters.
type Provider ¶
type Provider struct {
*ProviderV0
}
Provider is like ProviderV0, but implements the PodNotifier interface
func NewProvider ¶
func NewProvider(providerConfig, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*Provider, error)
NewProvider creates a new Provider, which implements the PodNotifier interface
type ProviderV0 ¶
type ProviderV0 struct {
// contains filtered or unexported fields
}
ProviderV0 implements the virtual-kubelet provider interface and stores pods in memory.
func NewProviderV0 ¶
func NewProviderV0(providerConfig, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*ProviderV0, error)
NewProviderV0 creates a new ProviderV0
func NewProviderV0Config ¶
func NewProviderV0Config(config Config, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*ProviderV0, error)
NewProviderConfig creates a new ProviderV0. Mock legacy provider does not implement the new asynchronous podnotifier interface
func (*ProviderV0) ConfigureNode ¶
func (p *ProviderV0) ConfigureNode(ctx context.Context, n *v1.Node)
func (*ProviderV0) GetContainerLogs ¶
func (p *ProviderV0) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)
GetContainerLogs retrieves the logs of a container by name from the provider.
func (*ProviderV0) GetPodStatus ¶
func (p *ProviderV0) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
GetPodStatus returns the status of a pod by name that is "running". returns nil if a pod by that name is not found.
func (*ProviderV0) GetStatsSummary ¶
func (p *ProviderV0) GetStatsSummary(ctx context.Context) (*statsv1alpha1.Summary, error)
GetStatsSummary returns dummy stats for all pods known by this provider.
func (*ProviderV0) RunInContainer ¶
func (p *ProviderV0) RunInContainer(ctx context.Context, namespace, name, container 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.