vkubelet

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodStatusReason_ProviderFailed = "ProviderFailed"
)

Variables

This section is empty.

Functions

func KubeletServerStart added in v0.5.2

func KubeletServerStart(p Provider)

KubeletServertStart starts the virtual kubelet HTTP server.

func MetricsServerStart added in v0.5.2

func MetricsServerStart(p Provider, addr string)

MetricsServerStart starts an HTTP server on the provided addr for serving the kubelset summary stats API. TLS is never enabled on this endpoint.

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound provides a handler for cases where the requested endpoint doesn't exist

Types

type KubeletServer added in v0.5.2

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

KubeletServer implements HTTP endpoints for serving kubelet API's

func (*KubeletServer) ApiServerHandler added in v0.5.2

func (s *KubeletServer) ApiServerHandler(w http.ResponseWriter, req *http.Request)

func (*KubeletServer) ApiServerHandlerExec added in v0.5.2

func (s *KubeletServer) ApiServerHandlerExec(w http.ResponseWriter, req *http.Request)

type MetricsProvider added in v0.5.2

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

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

type MetricsServer added in v0.5.2

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

MetricsServer provides an HTTP endpopint for accessing pod metrics

func (*MetricsServer) MetricsSummaryHandler added in v0.5.2

func (s *MetricsServer) MetricsSummaryHandler(w http.ResponseWriter, req *http.Request)

MetricsSummaryHandler is an HTTP handler for implementing the kubelet summary stats endpoint

type Provider

type Provider interface {
	// CreatePod takes a Kubernetes Pod and deploys it within the provider.
	CreatePod(pod *v1.Pod) error

	// UpdatePod takes a Kubernetes Pod and updates it within the provider.
	UpdatePod(pod *v1.Pod) error

	// DeletePod takes a Kubernetes Pod and deletes it from the provider.
	DeletePod(pod *v1.Pod) error

	// GetPod retrieves a pod by name from the provider (can be cached).
	GetPod(namespace, name string) (*v1.Pod, error)

	// GetContainerLogs retrieves the logs of a container by name from the provider.
	GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)

	// ExecInContainer executes a command in a container in the pod, copying data
	// between in/out/err and the container's stdin/stdout/stderr.
	ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error

	// GetPodStatus retrieves the status of a pod by name from the provider.
	GetPodStatus(namespace, name string) (*v1.PodStatus, error)

	// GetPods retrieves a list of all pods running on the provider (can be cached).
	GetPods() ([]*v1.Pod, error)

	// Capacity returns a resource list with the capacity constraints of the provider.
	Capacity() v1.ResourceList

	// NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), which is
	// polled periodically to update the node status within Kubernetes.
	NodeConditions() []v1.NodeCondition

	// NodeAddresses returns a list of addresses for the node status
	// within Kubernetes.
	NodeAddresses() []v1.NodeAddress

	// NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status
	// within Kubernetes.
	NodeDaemonEndpoints() *v1.NodeDaemonEndpoints

	// OperatingSystem returns the operating system the provider is for.
	OperatingSystem() string
}

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

type Server

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

Server masquarades itself as a kubelet and allows for the virtual node to be backed by non-vm/node providers.

func New

func New(nodeName, operatingSystem, namespace, kubeConfig, provider, providerConfig, taintKey string, disableTaint bool, metricsAddr string) (*Server, error)

New creates a new virtual-kubelet server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server, registers it with Kubernetes and begins watching/reconciling the cluster. Run will block until Stop is called or a SIGINT or SIGTERM signal is received.

func (*Server) Stop

func (s *Server) Stop()

Stop shutsdown the server. It does not shutdown pods assigned to the virtual node.

Jump to

Keyboard shortcuts

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