containerd

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package containerd tracks the current containerd status.

Index

Constants

View Source
const (
	Name                       = "containerd"
	DanglingDegradedThreshold  = 5
	DanglingUnhealthyThreshold = 10
)

Name is the ID of the containerd component.

View Source
const (
	DefaultContainerRuntimeEndpoint = "unix:///run/containerd/containerd.sock"
)

Variables

This section is empty.

Functions

func CheckContainerdInstalled added in v0.9.0

func CheckContainerdInstalled() bool

CheckContainerdInstalled returns true if the containerd binary is available in PATH.

func CheckContainerdRunning added in v0.9.0

func CheckContainerdRunning(ctx context.Context) bool

func CheckSocketExists added in v0.9.0

func CheckSocketExists() bool

func GetVersion added in v0.9.0

func GetVersion(ctx context.Context, endpoint string) (string, error)

GetVersion gets the version of the containerd runtime.

func GetVersionFromCli added in v0.9.0

func GetVersionFromCli(ctx context.Context) (string, error)

GetVersionFromCli reads the containerd version from the command "containerd --version". e.g., "containerd containerd.io 1.7.25 bcc810d6b9066471b0b6fa75f557a15a1cbf31bb"

func IsErrUnimplemented added in v0.9.0

func IsErrUnimplemented(err error) bool

IsErrUnimplemented checks if the error is due to the unimplemented service. e.g., rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService

func New

func New(gpudInstance *components.GPUdInstance) (components.Component, error)

Types

type PodSandbox added in v0.9.0

type PodSandbox struct {
	ID        string `json:"id,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name,omitempty"`

	// Creation time of the container in nanoseconds.
	CreatedAt int64 `json:"created_at,omitempty"`

	// State of the PodSandbox.
	// e.g., "SANDBOX_READY" or "SANDBOX_NOTREADY".
	// ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#PodSandboxState
	State string `json:"state,omitempty"`

	Containers []PodSandboxContainerStatus `json:"containers,omitempty"`
}

PodSandbox represents the pod information fetched from the local container runtime. Simplified version of k8s.io/cri-api/pkg/apis/runtime/v1.PodSandbox. ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#ListPodSandboxResponse

func ListAllSandboxes added in v0.9.0

func ListAllSandboxes(ctx context.Context, endpoint string) ([]PodSandbox, error)

ListAllSandboxes lists all sandboxes from the containerd runtime.

type PodSandboxContainerStatus added in v0.9.0

type PodSandboxContainerStatus struct {
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Image string `json:"image,omitempty"`

	// Creation time of the container in nanoseconds.
	CreatedAt int64 `json:"created_at,omitempty"`

	// State of the container.
	// e.g., "CONTAINER_CREATED", "CONTAINER_RUNNING", "CONTAINER_EXITED", "CONTAINER_UNKNOWN".
	// ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#ContainerState
	State string `json:"state,omitempty"`
}

ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#ContainerStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL