Documentation
¶
Overview ¶
Package containerd tracks the current containerd status.
Index ¶
- Constants
- func CheckContainerdInstalled() bool
- func CheckContainerdRunning(ctx context.Context) bool
- func CheckSocketExists() bool
- func GetVersion(ctx context.Context, endpoint string) (string, error)
- func GetVersionFromCli(ctx context.Context) (string, error)
- func IsErrUnimplemented(err error) bool
- func New(gpudInstance *components.GPUdInstance) (components.Component, error)
- type PodSandbox
- type PodSandboxContainerStatus
Constants ¶
const ( Name = "containerd" DanglingDegradedThreshold = 5 DanglingUnhealthyThreshold = 10 )
Name is the ID of the containerd component.
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 CheckSocketExists ¶ added in v0.9.0
func CheckSocketExists() bool
func GetVersion ¶ added in v0.9.0
GetVersion gets the version of the containerd runtime.
func GetVersionFromCli ¶ added in v0.9.0
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
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