kubernetes: k8s.io/kubernetes/pkg/kubelet/dockershim Index | Files | Directories

package dockershim

import "k8s.io/kubernetes/pkg/kubelet/dockershim"

Docker integration using k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go

Index

Package Files

convert.go doc.go docker_checkpoint.go docker_container.go docker_container_unsupported.go docker_image.go docker_image_linux.go docker_legacy_service.go docker_logs.go docker_sandbox.go docker_service.go docker_stats.go docker_stats_linux.go docker_streaming.go docker_streaming_others.go exec.go helpers.go helpers_linux.go naming.go security_context.go selinux_util.go

Constants

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://"
)

func DefaultMemorySwap Uses

func DefaultMemorySwap() int64

func NewDockerClientFromConfig Uses

func NewDockerClientFromConfig(config *ClientConfig) libdocker.Interface

NewDockerClientFromConfig create a docker client from given configure return nil if nil configure is given.

type CRIService Uses

type CRIService interface {
    runtimeapi.RuntimeServiceServer
    runtimeapi.ImageServiceServer
    Start() error
}

CRIService includes all methods necessary for a CRI server.

type CheckpointData Uses

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

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

type ClientConfig Uses

type ClientConfig struct {
    DockerEndpoint            string
    RuntimeRequestTimeout     time.Duration
    ImagePullProgressDeadline time.Duration

    // Configuration for fake docker client
    EnableSleep       bool
    WithTraceDisabled bool
}

ClientConfig is parameters used to initialize docker client

type DockerLegacyService Uses

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

    // IsCRISupportedLogDriver checks whether the logging driver used by docker is
    // supported by native CRI integration.
    // TODO(resouer): remove this when deprecating unsupported log driver
    IsCRISupportedLogDriver() (bool, error)

    kuberuntime.LegacyLogProvider
}

DockerLegacyService interface embeds some legacy methods for backward compatibility. This file/interface will be removed in the near future. Do not modify or add more functions.

type DockerService Uses

type DockerService interface {
    CRIService

    // For serving streaming calls.
    http.Handler

    // For supporting legacy features.
    DockerLegacyService
}

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

func NewDockerService Uses

func NewDockerService(config *ClientConfig, podSandboxImage string, streamingConfig *streaming.Config, pluginSettings *NetworkPluginSettings,
    cgroupsName string, kubeCgroupDriver string, dockershimRootDir string, startLocalStreamingServer bool) (DockerService, error)

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

type DockershimCheckpoint Uses

type DockershimCheckpoint interface {
    checkpointmanager.Checkpoint
    GetData() (string, string, string, []*PortMapping, bool)
}

func NewPodSandboxCheckpoint Uses

func NewPodSandboxCheckpoint(namespace, name string, data *CheckpointData) DockershimCheckpoint

type ExecHandler Uses

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 NativeExecHandler Uses

type NativeExecHandler struct{}

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

func (*NativeExecHandler) ExecInContainer Uses

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 Uses

type NetworkPluginSettings struct {
    // HairpinMode is best described by comments surrounding the kubelet arg
    HairpinMode kubeletconfig.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
    // PluginBinDirString is a list of directiores delimited by commas, in
    // which the binaries for the plugin with PluginName may be found.
    PluginBinDirString string
    // PluginBinDirs is an array of directories in which the binaries for
    // the plugin with PluginName may be found. The admin is responsible for
    // provisioning these binaries before-hand.
    PluginBinDirs []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
    // PluginCacheDir is the directory in which CNI should store cache files.
    PluginCacheDir string
    // MTU is the desired MTU for network devices created by the plugin.
    MTU int
}

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 PodSandboxCheckpoint Uses

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 checksum.Checksum `json:"checksum"`
}

PodSandboxCheckpoint is the checkpoint structure for a sandbox

func (*PodSandboxCheckpoint) GetData Uses

func (cp *PodSandboxCheckpoint) GetData() (string, string, string, []*PortMapping, bool)

func (*PodSandboxCheckpoint) MarshalCheckpoint Uses

func (cp *PodSandboxCheckpoint) MarshalCheckpoint() ([]byte, error)

func (*PodSandboxCheckpoint) UnmarshalCheckpoint Uses

func (cp *PodSandboxCheckpoint) UnmarshalCheckpoint(blob []byte) error

func (*PodSandboxCheckpoint) VerifyChecksum Uses

func (cp *PodSandboxCheckpoint) VerifyChecksum() error

type PortMapping Uses

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"`
    // Host ip to expose.
    HostIP string `json:"host_ip,omitempty"`
}

PortMapping is the port mapping configurations of a sandbox.

type Protocol Uses

type Protocol string

Directories

PathSynopsis
cm
libdocker
metrics
network
network/cni
network/cni/testingmock_cni is a mock of the `libcni.CNI` interface.
network/hairpin
network/hostport
network/hostport/testing
network/kubenet
network/metrics
network/testing
remote

Package dockershim imports 57 packages (graph) and is imported by 84 packages. Updated 2019-11-15. Refresh now. Tools for package owners.