Documentation ¶
Overview ¶
Package cruntime contains code specific to container runtimes
Index ¶
- type CRIO
- func (r *CRIO) Active() bool
- func (r *CRIO) Available() error
- func (r *CRIO) ContainerLogCmd(id string, len int, follow bool) string
- func (r *CRIO) DefaultCNI() bool
- func (r *CRIO) Disable() error
- func (r *CRIO) Enable() error
- func (r *CRIO) KillContainers(ids []string) error
- func (r *CRIO) KubeletOptions() map[string]string
- func (r *CRIO) ListContainers(filter string) ([]string, error)
- func (r *CRIO) LoadImage(path string) error
- func (r *CRIO) Name() string
- func (r *CRIO) SocketPath() string
- func (r *CRIO) StopContainers(ids []string) error
- func (r *CRIO) Style() console.StyleEnum
- func (r *CRIO) Version() (string, error)
- type CommandRunner
- type Config
- type Containerd
- func (r *Containerd) Active() bool
- func (r *Containerd) Available() error
- func (r *Containerd) ContainerLogCmd(id string, len int, follow bool) string
- func (r *Containerd) DefaultCNI() bool
- func (r *Containerd) Disable() error
- func (r *Containerd) Enable() error
- func (r *Containerd) KillContainers(ids []string) error
- func (r *Containerd) KubeletOptions() map[string]string
- func (r *Containerd) ListContainers(filter string) ([]string, error)
- func (r *Containerd) LoadImage(path string) error
- func (r *Containerd) Name() string
- func (r *Containerd) SocketPath() string
- func (r *Containerd) StopContainers(ids []string) error
- func (r *Containerd) Style() console.StyleEnum
- func (r *Containerd) Version() (string, error)
- type Docker
- func (r *Docker) Active() bool
- func (r *Docker) Available() error
- func (r *Docker) ContainerLogCmd(id string, len int, follow bool) string
- func (r *Docker) DefaultCNI() bool
- func (r *Docker) Disable() error
- func (r *Docker) Enable() error
- func (r *Docker) KillContainers(ids []string) error
- func (r *Docker) KubeletOptions() map[string]string
- func (r *Docker) ListContainers(filter string) ([]string, error)
- func (r *Docker) LoadImage(path string) error
- func (r *Docker) Name() string
- func (r *Docker) SocketPath() string
- func (r *Docker) StopContainers(ids []string) error
- func (r *Docker) Style() console.StyleEnum
- func (r *Docker) Version() (string, error)
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRIO ¶
type CRIO struct { Socket string Runner CommandRunner }
CRIO contains CRIO runtime state
func (*CRIO) Available ¶
Available returns an error if it is not possible to use this runtime on a host
func (*CRIO) ContainerLogCmd ¶
ContainerLogCmd returns the command to retrieve the log for a container based on ID
func (*CRIO) DefaultCNI ¶
DefaultCNI returns whether to use CNI networking by default
func (*CRIO) KillContainers ¶
KillContainers removes containers based on ID
func (*CRIO) KubeletOptions ¶
KubeletOptions returns kubelet options for a runtime.
func (*CRIO) ListContainers ¶
ListContainers returns a list of managed by this container runtime
func (*CRIO) SocketPath ¶
SocketPath returns the path to the socket file for CRIO
func (*CRIO) StopContainers ¶
StopContainers stops containers based on ID
type CommandRunner ¶
CommandRunner is the subset of bootstrapper.CommandRunner this package consumes
type Config ¶
type Config struct { // Type of runtime to create ("docker, "crio", etc) Type string // Custom path to a socket file Socket string // Runner is the CommandRunner object to execute commands with Runner CommandRunner }
Config is runtime configuration
type Containerd ¶
type Containerd struct { Socket string Runner CommandRunner }
Containerd contains containerd runtime state
func (*Containerd) Active ¶
func (r *Containerd) Active() bool
Active returns if containerd is active on the host
func (*Containerd) Available ¶
func (r *Containerd) Available() error
Available returns an error if it is not possible to use this runtime on a host
func (*Containerd) ContainerLogCmd ¶
func (r *Containerd) ContainerLogCmd(id string, len int, follow bool) string
ContainerLogCmd returns the command to retrieve the log for a container based on ID
func (*Containerd) DefaultCNI ¶
func (r *Containerd) DefaultCNI() bool
DefaultCNI returns whether to use CNI networking by default
func (*Containerd) Disable ¶
func (r *Containerd) Disable() error
Disable idempotently disables containerd on a host
func (*Containerd) Enable ¶
func (r *Containerd) Enable() error
Enable idempotently enables containerd on a host
func (*Containerd) KillContainers ¶
func (r *Containerd) KillContainers(ids []string) error
KillContainers removes containers based on ID
func (*Containerd) KubeletOptions ¶
func (r *Containerd) KubeletOptions() map[string]string
KubeletOptions returns kubelet options for a containerd
func (*Containerd) ListContainers ¶
func (r *Containerd) ListContainers(filter string) ([]string, error)
ListContainers returns a list of managed by this container runtime
func (*Containerd) LoadImage ¶
func (r *Containerd) LoadImage(path string) error
LoadImage loads an image into this runtime
func (*Containerd) Name ¶
func (r *Containerd) Name() string
Name is a human readable name for containerd
func (*Containerd) SocketPath ¶
func (r *Containerd) SocketPath() string
SocketPath returns the path to the socket file for containerd
func (*Containerd) StopContainers ¶
func (r *Containerd) StopContainers(ids []string) error
StopContainers stops containers based on ID
func (*Containerd) Style ¶ added in v1.1.1
func (r *Containerd) Style() console.StyleEnum
func (*Containerd) Version ¶ added in v1.0.0
func (r *Containerd) Version() (string, error)
Version retrieves the current version of this runtime
type Docker ¶
type Docker struct { Socket string Runner CommandRunner }
Docker contains Docker runtime state
func (*Docker) Available ¶
Available returns an error if it is not possible to use this runtime on a host
func (*Docker) ContainerLogCmd ¶
ContainerLogCmd returns the command to retrieve the log for a container based on ID
func (*Docker) DefaultCNI ¶
DefaultCNI returns whether to use CNI networking by default
func (*Docker) KillContainers ¶
KillContainers forcibly removes a running container based on ID
func (*Docker) KubeletOptions ¶
KubeletOptions returns kubelet options for a runtime.
func (*Docker) ListContainers ¶
ListContainers returns a list of containers
func (*Docker) SocketPath ¶
SocketPath returns the path to the socket file for Docker
func (*Docker) StopContainers ¶
StopContainers stops a running container based on ID
type Manager ¶
type Manager interface { // Name is a human readable name for a runtime Name() string // Version retrieves the current version of this runtime Version() (string, error) // Enable idempotently enables this runtime on a host Enable() error // Disable idempotently disables this runtime on a host Disable() error // Active returns whether or not a runtime is active on a host Active() bool // Available returns an error if it is not possible to use this runtime on a host Available() error // Style is an associated StyleEnum for Name() Style() console.StyleEnum // KubeletOptions returns kubelet options for a runtime. KubeletOptions() map[string]string // SocketPath returns the path to the socket file for a given runtime SocketPath() string // DefaultCNI returns whether to use CNI networking by default DefaultCNI() bool // Load an image idempotently into the runtime on a host LoadImage(string) error // ListContainers returns a list of managed by this container runtime ListContainers(string) ([]string, error) // KillContainers removes containers based on ID KillContainers([]string) error // StopContainers stops containers based on ID StopContainers([]string) error // ContainerLogCmd returns the command to retrieve the log for a container based on ID ContainerLogCmd(string, int, bool) string }
Manager is a common interface for container runtimes