api

package
v0.0.0-...-0deb509 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package api implements HTTP handlers for handling requests that the kubelet would normally implement, such as pod logs, exec, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PodExecHandlerFunc

func PodExecHandlerFunc(backend ExecBackend) http.HandlerFunc

PodExecHandlerFunc makes an http handler func from a Provider which execs a command in a pod's container Note that this handler currently depends on gorrilla/mux to get url parts as variables. TODO(@cpuguy83): don't force gorilla/mux on consumers of this function

func PodLogsHandlerFunc

func PodLogsHandlerFunc(p ContainerLogsBackend) http.HandlerFunc

PodLogsHandlerFunc creates an http handler function from a provider to serve logs from a pod

func PodMetricsHandlerFunc

func PodMetricsHandlerFunc(b PodMetricsBackend) http.HandlerFunc

PodMetricsHandlerFunc makes an HTTP handler for implementing the kubelet summary stats endpoint

Types

type ContainerLogsBackend

type ContainerLogsBackend interface {
	GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts providers.ContainerLogOpts) (io.ReadCloser, error)
}

ContainerLogsBackend is used in place of backend implementations for getting container logs

type ExecBackend

type ExecBackend interface {
	RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, attach providers.AttachIO) error
}

type PodMetricsBackend

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

PodMetricsBackend is used in place of backend implementations to get k8s pod metrics.

Jump to

Keyboard shortcuts

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