Documentation
¶
Overview ¶
Package cruntime contains code specific to container runtimes
Index ¶
- Constants
- 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(disOthers bool) error
- func (r *CRIO) ImageExists(name string, sha string) bool
- 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() out.StyleEnum
- func (r *CRIO) SystemLogCmd(len int) string
- 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(disOthers bool) error
- func (r *Containerd) ImageExists(name string, sha string) bool
- 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() out.StyleEnum
- func (r *Containerd) SystemLogCmd(len int) string
- 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(disOthers bool) error
- func (r *Docker) ImageExists(name string, sha string) bool
- 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() out.StyleEnum
- func (r *Docker) SystemLogCmd(len int) string
- func (r *Docker) Version() (string, error)
- type Manager
Constants ¶
const KubernetesContainerPrefix = "k8s_"
KubernetesContainerPrefix is the prefix of each kubernetes container
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRIO ¶
type CRIO struct { Socket string Runner CommandRunner ImageRepository string KubernetesVersion string }
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) ImageExists ¶ added in v1.6.0
ImageExists checks if an image exists
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
func (*CRIO) SystemLogCmd ¶ added in v1.3.0
SystemLogCmd returns the command to retrieve system logs
type CommandRunner ¶
CommandRunner is the subset of command.Runner 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 // ImageRepository image repository to download image from ImageRepository string // KubernetesVersion Kubernetes version KubernetesVersion string }
Config is runtime configuration
type Containerd ¶
type Containerd struct { Socket string Runner CommandRunner ImageRepository string KubernetesVersion string }
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(disOthers bool) error
Enable idempotently enables containerd on a host
func (*Containerd) ImageExists ¶ added in v1.6.0
func (r *Containerd) ImageExists(name string, sha string) bool
ImageExists checks if an image exists, expected input format
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() out.StyleEnum
Style is the console style for containerd
func (*Containerd) SystemLogCmd ¶ added in v1.3.0
func (r *Containerd) SystemLogCmd(len int) string
SystemLogCmd returns the command to retrieve system logs
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) ImageExists ¶ added in v1.6.0
ImageExists checks if an image exists
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
func (*Docker) SystemLogCmd ¶ added in v1.3.0
SystemLogCmd returns the command to retrieve system logs
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(bool) 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() out.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 // ImageExists takes image name and image sha checks if an it exists ImageExists(string, string) bool // 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 // SystemLogCmd returns the command to return the system logs SystemLogCmd(int) string }
Manager is a common interface for container runtimes