dockershim

package
v1.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2017 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Overview

Docker integration using pkg/kubelet/apis/cri/v1alpha1/runtime/api.pb.go

Index

Constants

View Source
const (

	// DockerImageIDPrefix is the prefix of image id in container status.
	DockerImageIDPrefix = "docker://"
	// DockerPullableImageIDPrefix is the prefix of pullable image id in container status.
	DockerPullableImageIDPrefix = "docker-pullable://"
)

Variables

This section is empty.

Functions

func DefaultMemorySwap added in v1.7.0

func DefaultMemorySwap() int64

func IsCRISupportedLogDriver added in v1.6.0

func IsCRISupportedLogDriver(client libdocker.Interface) (bool, error)

IsCRISupportedLogDriver checks whether the logging driver used by docker is suppoted by native CRI integration.

Types

type CheckpointData added in v1.6.0

type CheckpointData struct {
	PortMappings []*PortMapping `json:"port_mappings,omitempty"`
}

CheckpointData contains all types of data that can be stored in the checkpoint.

type CheckpointHandler added in v1.6.0

type CheckpointHandler interface {
	// CreateCheckpoint persists sandbox checkpoint in CheckpointStore.
	CreateCheckpoint(podSandboxID string, checkpoint *PodSandboxCheckpoint) error
	// GetCheckpoint retrieves sandbox checkpoint from CheckpointStore.
	GetCheckpoint(podSandboxID string) (*PodSandboxCheckpoint, error)
	// RemoveCheckpoint removes sandbox checkpoint form CheckpointStore.
	// WARNING: RemoveCheckpoint will not return error if checkpoint does not exist.
	RemoveCheckpoint(podSandboxID string) error
	// ListCheckpoint returns the list of existing checkpoints.
	ListCheckpoints() ([]string, error)
}

CheckpointHandler provides the interface to manage PodSandbox checkpoint

func NewPersistentCheckpointHandler added in v1.6.0

func NewPersistentCheckpointHandler(dockershimRootDir string) (CheckpointHandler, error)

type CheckpointStore added in v1.6.0

type CheckpointStore interface {
	// key must contain one or more characters in [A-Za-z0-9]
	// Write persists a checkpoint with key
	Write(key string, data []byte) error
	// Read retrieves a checkpoint with key
	// Read must return CheckpointNotFoundError if checkpoint is not found
	Read(key string) ([]byte, error)
	// Delete deletes a checkpoint with key
	// Delete must not return error if checkpoint does not exist
	Delete(key string) error
	// List lists all keys of existing checkpoints
	List() ([]string, error)
}

CheckpointStore provides the interface for checkpoint storage backend. CheckpointStore must be thread-safe

func NewFileStore added in v1.6.0

func NewFileStore(path string) (CheckpointStore, error)

type DockerLegacyService

type DockerLegacyService interface {
	// GetContainerLogs gets logs for a specific container.
	GetContainerLogs(*v1.Pod, kubecontainer.ContainerID, *v1.PodLogOptions, io.Writer, io.Writer) error
}

DockerLegacyService interface embeds some legacy methods for backward compatibility.

func NewDockerLegacyService added in v1.6.0

func NewDockerLegacyService(client libdocker.Interface) DockerLegacyService

type DockerService added in v1.5.0

type DockerService interface {
	internalapi.RuntimeService
	internalapi.ImageManagerService
	Start() error
	// For serving streaming calls.
	http.Handler
}

DockerService is an interface that embeds the new RuntimeService and ImageService interfaces.

func NewDockerService added in v1.5.0

func NewDockerService(client libdocker.Interface, seccompProfileRoot string, podSandboxImage string, streamingConfig *streaming.Config,
	pluginSettings *NetworkPluginSettings, cgroupsName string, kubeCgroupDriver string, execHandlerName, dockershimRootDir string, disableSharedPID bool) (DockerService, error)

NOTE: Anything passed to DockerService should be eventually handled in another way when we switch to running the shim as a different process.

type ExecHandler added in v1.7.0

type ExecHandler interface {
	ExecInContainer(client libdocker.Interface, container *dockertypes.ContainerJSON, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
}

ExecHandler knows how to execute a command in a running Docker container.

type FileStore added in v1.6.0

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

FileStore is an implementation of CheckpointStore interface which stores checkpoint in files.

func (*FileStore) Delete added in v1.6.0

func (fstore *FileStore) Delete(key string) error

func (*FileStore) List added in v1.6.0

func (fstore *FileStore) List() ([]string, error)

func (*FileStore) Read added in v1.6.0

func (fstore *FileStore) Read(key string) ([]byte, error)

func (*FileStore) Write added in v1.6.0

func (fstore *FileStore) Write(key string, data []byte) error

type NativeExecHandler added in v1.7.0

type NativeExecHandler struct{}

NativeExecHandler executes commands in Docker containers using Docker's exec API.

func (*NativeExecHandler) ExecInContainer added in v1.7.0

func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container *dockertypes.ContainerJSON, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error

type NetworkPluginSettings added in v1.5.0

type NetworkPluginSettings struct {
	// HairpinMode is best described by comments surrounding the kubelet arg
	HairpinMode componentconfig.HairpinMode
	// NonMasqueradeCIDR is the range of ips which should *not* be included
	// in any MASQUERADE rules applied by the plugin
	NonMasqueradeCIDR string
	// PluginName is the name of the plugin, runtime shim probes for
	PluginName string
	// PluginBinDir is the directory in which the binaries for the plugin with
	// PluginName is kept. The admin is responsible for provisioning these
	// binaries before-hand.
	PluginBinDir string
	// PluginConfDir is the directory in which the admin places a CNI conf.
	// Depending on the plugin, this may be an optional field, eg: kubenet
	// generates its own plugin conf.
	PluginConfDir string
	// MTU is the desired MTU for network devices created by the plugin.
	MTU int

	// RuntimeHost is an interface that serves as a trap-door from plugin back
	// into the kubelet.
	// TODO: This shouldn't be required, remove once we move host ports into CNI
	// and figure out bandwidth shaping. See corresponding comments above
	// network.Host interface.
	LegacyRuntimeHost network.LegacyHost
}

NetworkPluginSettings is the subset of kubelet runtime args we pass to the container runtime shim so it can probe for network plugins. In the future we will feed these directly to a standalone container runtime process.

type NsenterExecHandler added in v1.7.0

type NsenterExecHandler struct{}

NsenterExecHandler executes commands in Docker containers using nsenter.

func (*NsenterExecHandler) ExecInContainer added in v1.7.0

func (*NsenterExecHandler) ExecInContainer(client libdocker.Interface, container *dockertypes.ContainerJSON, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error

TODO should we support nsenter in a container, running with elevated privs and --pid=host?

type PersistentCheckpointHandler added in v1.6.0

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

PersistentCheckpointHandler is an implementation of CheckpointHandler. It persists checkpoint in CheckpointStore

func (*PersistentCheckpointHandler) CreateCheckpoint added in v1.6.0

func (handler *PersistentCheckpointHandler) CreateCheckpoint(podSandboxID string, checkpoint *PodSandboxCheckpoint) error

func (*PersistentCheckpointHandler) GetCheckpoint added in v1.6.0

func (handler *PersistentCheckpointHandler) GetCheckpoint(podSandboxID string) (*PodSandboxCheckpoint, error)

func (*PersistentCheckpointHandler) ListCheckpoints added in v1.6.0

func (handler *PersistentCheckpointHandler) ListCheckpoints() ([]string, error)

func (*PersistentCheckpointHandler) RemoveCheckpoint added in v1.6.0

func (handler *PersistentCheckpointHandler) RemoveCheckpoint(podSandboxID string) error

type PodSandboxCheckpoint added in v1.6.0

type PodSandboxCheckpoint struct {
	// Version of the pod sandbox checkpoint schema.
	Version string `json:"version"`
	// Pod name of the sandbox. Same as the pod name in the PodSpec.
	Name string `json:"name"`
	// Pod namespace of the sandbox. Same as the pod namespace in the PodSpec.
	Namespace string `json:"namespace"`
	// Data to checkpoint for pod sandbox.
	Data *CheckpointData `json:"data,omitempty"`
	// Checksum is calculated with fnv hash of the checkpoint object with checksum field set to be zero
	CheckSum uint64 `json:"checksum"`
}

PodSandboxCheckpoint is the checkpoint structure for a sandbox

func NewPodSandboxCheckpoint added in v1.6.0

func NewPodSandboxCheckpoint(namespace, name string) *PodSandboxCheckpoint

type PortMapping added in v1.6.0

type PortMapping struct {
	// Protocol of the port mapping.
	Protocol *Protocol `json:"protocol,omitempty"`
	// Port number within the container.
	ContainerPort *int32 `json:"container_port,omitempty"`
	// Port number on the host.
	HostPort *int32 `json:"host_port,omitempty"`
}

PortMapping is the port mapping configurations of a sandbox.

type Protocol added in v1.6.0

type Protocol string

Directories

Path Synopsis
Package securitycontext contains security context api implementations
Package securitycontext contains security context api implementations

Jump to

Keyboard shortcuts

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