Documentation ¶
Overview ¶
Package rktshim is the package that contains the shim code for rkt to be used as the kubelet container runtime implementation that is integrated using the Container Runtime Interface.
Index ¶
- Constants
- Variables
- func NewFakeRuntime() (kubeletapi.ContainerManager, error)
- func NewPodSandboxManager(PodSandboxManagerConfig) (kubeletapi.PodSandboxManager, error)
- func NewRuntime(RuntimeConfig) (kubeletapi.ContainerManager, error)
- type FakeRuntime
- func (r *FakeRuntime) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
- func (r *FakeRuntime) ContainerStatus(id string) (*runtimeapi.ContainerStatus, error)
- func (r *FakeRuntime) CreateContainer(pid string, cfg *runtimeapi.ContainerConfig, ...) (string, error)
- func (r *FakeRuntime) Exec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
- func (r *FakeRuntime) ExecSync(containerID string, cmd []string, timeout time.Duration) (stdout []byte, stderr []byte, err error)
- func (r *FakeRuntime) ListContainers(*runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
- func (r *FakeRuntime) RemoveContainer(id string) error
- func (r *FakeRuntime) StartContainer(id string) error
- func (r *FakeRuntime) StopContainer(id string, timeout int64) error
- func (r *FakeRuntime) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
- type FakeRuntimeConfig
- type ImageStore
- type ImageStoreConfig
- type PodSandboxManager
- func (*PodSandboxManager) ListPodSandbox(*runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
- func (*PodSandboxManager) PodSandboxStatus(string) (*runtimeapi.PodSandboxStatus, error)
- func (*PodSandboxManager) PortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
- func (*PodSandboxManager) RemovePodSandbox(string) error
- func (*PodSandboxManager) RunPodSandbox(*runtimeapi.PodSandboxConfig) (string, error)
- func (*PodSandboxManager) StopPodSandbox(string) error
- type PodSandboxManagerConfig
- type Runtime
- func (*Runtime) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
- func (*Runtime) ContainerStatus(string) (*runtimeapi.ContainerStatus, error)
- func (*Runtime) CreateContainer(string, *runtimeapi.ContainerConfig, *runtimeapi.PodSandboxConfig) (string, error)
- func (*Runtime) Exec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
- func (*Runtime) ExecSync(containerID string, cmd []string, timeout time.Duration) (stdout []byte, stderr []byte, err error)
- func (*Runtime) ListContainers(*runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
- func (*Runtime) RemoveContainer(string) error
- func (*Runtime) StartContainer(string) error
- func (*Runtime) StopContainer(string, int64) error
- func (*Runtime) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
- type RuntimeConfig
Constants ¶
const ( FakeStreamingHost = "localhost" FakeStreamingPort = "12345" )
Variables ¶
var ( ErrContainerNotFound = errors.New("rktshim: container not found") ErrInvalidContainerStateTransition = errors.New("rktshim: wrong container operation for current state") )
var (
ErrImageNotFound = errors.New("rktshim: image not found")
)
TODO(tmrts): Move these errors to the container API for code re-use.
Functions ¶
func NewFakeRuntime ¶
func NewFakeRuntime() (kubeletapi.ContainerManager, error)
func NewPodSandboxManager ¶
func NewPodSandboxManager(PodSandboxManagerConfig) (kubeletapi.PodSandboxManager, error)
NewPodSandboxManager creates a PodSandboxManager.
func NewRuntime ¶
func NewRuntime(RuntimeConfig) (kubeletapi.ContainerManager, error)
NewRuntime creates a container.Runtime instance using the Runtime.
Types ¶
type FakeRuntime ¶
type FakeRuntime struct {
Containers containerRegistry
}
func (*FakeRuntime) Attach ¶ added in v1.5.0
func (r *FakeRuntime) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
func (*FakeRuntime) ContainerStatus ¶
func (r *FakeRuntime) ContainerStatus(id string) (*runtimeapi.ContainerStatus, error)
func (*FakeRuntime) CreateContainer ¶
func (r *FakeRuntime) CreateContainer(pid string, cfg *runtimeapi.ContainerConfig, sandboxCfg *runtimeapi.PodSandboxConfig) (string, error)
func (*FakeRuntime) Exec ¶
func (r *FakeRuntime) Exec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
func (*FakeRuntime) ListContainers ¶
func (r *FakeRuntime) ListContainers(*runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
func (*FakeRuntime) RemoveContainer ¶
func (r *FakeRuntime) RemoveContainer(id string) error
func (*FakeRuntime) StartContainer ¶
func (r *FakeRuntime) StartContainer(id string) error
func (*FakeRuntime) StopContainer ¶
func (r *FakeRuntime) StopContainer(id string, timeout int64) error
func (*FakeRuntime) UpdateContainerResources ¶ added in v1.8.0
func (r *FakeRuntime) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
type FakeRuntimeConfig ¶
type FakeRuntimeConfig struct{}
type ImageStore ¶
type ImageStore struct{}
ImageStore supports CRUD operations for images.
func NewImageStore ¶
func NewImageStore(ImageStoreConfig) (*ImageStore, error)
NewImageStore creates an image storage that allows CRUD operations for images.
func (*ImageStore) List ¶
func (*ImageStore) List() ([]runtimeapi.Image, error)
List lists the images residing in the image store.
func (*ImageStore) Pull ¶
func (*ImageStore) Pull(runtimeapi.ImageSpec, runtimeapi.AuthConfig, *runtimeapi.PodSandboxConfig) error
Pull pulls an image into the image store and uses the given authentication method.
func (*ImageStore) Remove ¶
func (*ImageStore) Remove(runtimeapi.ImageSpec) error
Remove removes the image from the image store.
func (*ImageStore) Status ¶
func (*ImageStore) Status(runtimeapi.ImageSpec) (runtimeapi.Image, error)
Status returns the status of the image.
type ImageStoreConfig ¶
type ImageStoreConfig struct{}
TODO(tmrts): fill the image store configuration fields.
type PodSandboxManager ¶
type PodSandboxManager struct{}
PodSandboxManager provides basic operations to create/delete and examine the pod sandboxes in a blocking manner.
func (*PodSandboxManager) ListPodSandbox ¶
func (*PodSandboxManager) ListPodSandbox(*runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
ListPodSandbox lists existing sandboxes, filtered by the PodSandboxFilter.
func (*PodSandboxManager) PodSandboxStatus ¶
func (*PodSandboxManager) PodSandboxStatus(string) (*runtimeapi.PodSandboxStatus, error)
PodSandboxStatus queries the status of the pod sandbox.
func (*PodSandboxManager) PortForward ¶ added in v1.5.0
func (*PodSandboxManager) PortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (*PodSandboxManager) RemovePodSandbox ¶
func (*PodSandboxManager) RemovePodSandbox(string) error
RemovePodSandbox deletes the pod sandbox and the apps inside the sandbox.
func (*PodSandboxManager) RunPodSandbox ¶ added in v1.5.0
func (*PodSandboxManager) RunPodSandbox(*runtimeapi.PodSandboxConfig) (string, error)
RunPodSandbox creates and starts a pod sandbox given a pod sandbox configuration.
func (*PodSandboxManager) StopPodSandbox ¶
func (*PodSandboxManager) StopPodSandbox(string) error
StopPodSandbox stops a pod sandbox and the apps inside the sandbox.
type PodSandboxManagerConfig ¶
type PodSandboxManagerConfig struct{}
TODO(tmrts): Fill the configuration struct fields.
type Runtime ¶
type Runtime struct{}
Runtime provides an API for lifecycle, inspection and introspection operations in a blocking manner using the App level API provided by rkt.
func (*Runtime) Attach ¶ added in v1.5.0
func (*Runtime) Attach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error)
Attach prepares a streaming endpoint to attach to a running container, and returns the address.
func (*Runtime) ContainerStatus ¶
func (*Runtime) ContainerStatus(string) (*runtimeapi.ContainerStatus, error)
ContainerStatus returns the RawContainerStatus of an app inside the pod sandbox.
func (*Runtime) CreateContainer ¶
func (*Runtime) CreateContainer(string, *runtimeapi.ContainerConfig, *runtimeapi.PodSandboxConfig) (string, error)
CreateContainer creates an app inside the provided pod sandbox and returns the RawContainerID.
func (*Runtime) Exec ¶
func (*Runtime) Exec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error)
Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
func (*Runtime) ExecSync ¶ added in v1.5.0
func (*Runtime) ExecSync(containerID string, cmd []string, timeout time.Duration) (stdout []byte, stderr []byte, err error)
ExecSync executes a command in the container, and returns the stdout output. If command exits with a non-zero exit code, an error is returned.
func (*Runtime) ListContainers ¶
func (*Runtime) ListContainers(*runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
ListContainers lists out the apps residing inside the pod sandbox using the ContainerFilter.
func (*Runtime) RemoveContainer ¶
RemoveContainer removes the app from a pod sandbox.
func (*Runtime) StartContainer ¶
StartContainer starts a created app.
func (*Runtime) StopContainer ¶
StopContainer stops a running app with a grace period (i.e. timeout).
func (*Runtime) UpdateContainerResources ¶ added in v1.8.0
func (*Runtime) UpdateContainerResources(string, *runtimeapi.LinuxContainerResources) error
UpdateContainerResources updates the resource constraints for the container.
type RuntimeConfig ¶
type RuntimeConfig struct{}
TODO(tmrts): Fill out the creation configuration fields.