package runtime
import "k8s.io/kubernetes/cmd/kubeadm/app/util/runtime"
Package runtime provides the kubeadm container runtime implementation.
Index ¶
- func DetectCRISocket() (string, error)
- type CRIRuntime
- func (runtime *CRIRuntime) Connect() error
- func (runtime *CRIRuntime) ImageExists(image string) bool
- func (runtime *CRIRuntime) IsRunning() error
- func (runtime *CRIRuntime) ListKubeContainers() ([]string, error)
- func (runtime *CRIRuntime) PullImage(image string) (err error)
- func (runtime *CRIRuntime) PullImagesInParallel(images []string, ifNotPresent bool) error
- func (runtime *CRIRuntime) RemoveContainers(containers []string) error
- func (runtime *CRIRuntime) SandboxImage() (string, error)
- func (runtime *CRIRuntime) SetImpl(impl impl)
- type ContainerRuntime
Functions ¶
func DetectCRISocket ¶
DetectCRISocket uses a list of known CRI sockets to detect one. If more than one or none is discovered, an error is returned.
Types ¶
type CRIRuntime ¶
type CRIRuntime struct {
// contains filtered or unexported fields
}
CRIRuntime is a struct that interfaces with the CRI
func (*CRIRuntime) Connect ¶
func (runtime *CRIRuntime) Connect() error
Connect establishes a connection with the CRI runtime.
func (*CRIRuntime) ImageExists ¶
func (runtime *CRIRuntime) ImageExists(image string) bool
ImageExists checks to see if the image exists on the system
func (*CRIRuntime) IsRunning ¶
func (runtime *CRIRuntime) IsRunning() error
IsRunning checks if runtime is running.
func (*CRIRuntime) ListKubeContainers ¶
func (runtime *CRIRuntime) ListKubeContainers() ([]string, error)
ListKubeContainers lists running k8s CRI pods
func (*CRIRuntime) PullImage ¶
func (runtime *CRIRuntime) PullImage(image string) (err error)
PullImage pulls the image
func (*CRIRuntime) PullImagesInParallel ¶
func (runtime *CRIRuntime) PullImagesInParallel(images []string, ifNotPresent bool) error
PullImagesInParallel pulls a list of images in parallel
func (*CRIRuntime) RemoveContainers ¶
func (runtime *CRIRuntime) RemoveContainers(containers []string) error
RemoveContainers removes running k8s pods
func (*CRIRuntime) SandboxImage ¶
func (runtime *CRIRuntime) SandboxImage() (string, error)
SandboxImage returns the sandbox image used by the container runtime
func (*CRIRuntime) SetImpl ¶
func (runtime *CRIRuntime) SetImpl(impl impl)
SetImpl can be used to set the internal implementation for testing purposes.
type ContainerRuntime ¶
type ContainerRuntime interface { Connect() error SetImpl(impl) IsRunning() error ListKubeContainers() ([]string, error) RemoveContainers(containers []string) error PullImage(image string) error PullImagesInParallel(images []string, ifNotPresent bool) error ImageExists(image string) bool SandboxImage() (string, error) }
ContainerRuntime is an interface for working with container runtimes
func NewContainerRuntime ¶
func NewContainerRuntime(criSocket string) ContainerRuntime
NewContainerRuntime sets up and returns a ContainerRuntime struct
Source Files ¶
impl.go runtime.go runtime_unix.go
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 3 hours ago –
Tools for package owners.