components

package
v1.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// DefaultDockerCRISocket defines the default Docker CRI socket
	DefaultDockerCRISocket = "/var/run/dockershim.sock"

	// PullImageRetry specifies how many times ContainerRuntime retries when pulling image failed
	PullImageRetry = 5
)
View Source
const (
	KubeletSvcEnv           = "KUBELET_SVC"
	KubeletSvcPathSystemUsr = "/usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf"
	KubelerSvcPathSystemEtc = "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
)

Variables

This section is empty.

Functions

func DetectCRISocket

func DetectCRISocket() (string, error)

DetectCRISocket uses a list of known CRI sockets to detect one. If more than one or none is discovered, an error is returned.

func GetAPIServerAddress added in v1.7.0

func GetAPIServerAddress(kubeadmConfPaths []string) (string, error)

GetAPIServerAddress parse apiServer address from conf file

func GetDefaultKubeadmConfPath

func GetDefaultKubeadmConfPath() []string

func NewKubeletOperator

func NewKubeletOperator(openyurtDir string) *kubeletOperator

NewKubeletOperator create kubeletOperator

func NewYurthubOperator

func NewYurthubOperator(cfg *yurthubutil.YurthubHostConfig) *yurtHubOperator

NewYurthubOperator creates an operator that manages host-level yurthub lifecycle with the systemd + binary deployment path.

func RestartNonPauseContainers added in v1.7.0

func RestartNonPauseContainers(nodeName, excludedPodPrefix string) error

func UnInstallYurtTunnelAgent added in v0.7.0

func UnInstallYurtTunnelAgent() error

func UnInstallYurtTunnelServer added in v0.7.0

func UnInstallYurtTunnelServer() error

Types

type CRIRuntime

type CRIRuntime struct {
	// contains filtered or unexported fields
}

CRIRuntime is a struct that interfaces with the CRI

func (*CRIRuntime) ImageExists

func (runtime *CRIRuntime) ImageExists(image string) (bool, error)

ImageExists checks to see if the image exists on the system

func (*CRIRuntime) IsDocker

func (runtime *CRIRuntime) IsDocker() bool

IsDocker returns true if the runtime is docker

func (*CRIRuntime) ListKubeContainers added in v1.7.0

func (runtime *CRIRuntime) ListKubeContainers() ([]KubeContainer, error)

func (*CRIRuntime) PullImage

func (runtime *CRIRuntime) PullImage(image string) error

PullImage pulls the image

func (*CRIRuntime) StopContainer added in v1.7.0

func (runtime *CRIRuntime) StopContainer(containerID string) error

type ContainerRuntimeForImage

type ContainerRuntimeForImage interface {
	IsDocker() bool
	PullImage(image string) error
	ImageExists(image string) (bool, error)
	ListKubeContainers() ([]KubeContainer, error)
	StopContainer(containerID string) error
}

ContainerRuntime is an interface for working with container runtimes

func NewContainerRuntimeForImage

func NewContainerRuntimeForImage(execer utilsexec.Interface, criSocket string) (ContainerRuntimeForImage, error)

NewContainerRuntime sets up and returns a ContainerRuntime struct

type DockerRuntime

type DockerRuntime struct {
	// contains filtered or unexported fields
}

DockerRuntime is a struct that interfaces with the Docker daemon

func (*DockerRuntime) ImageExists

func (runtime *DockerRuntime) ImageExists(image string) (bool, error)

ImageExists checks to see if the image exists on the system

func (*DockerRuntime) IsDocker

func (runtime *DockerRuntime) IsDocker() bool

IsDocker returns true if the runtime is docker

func (*DockerRuntime) ListKubeContainers added in v1.7.0

func (runtime *DockerRuntime) ListKubeContainers() ([]KubeContainer, error)

func (*DockerRuntime) PullImage

func (runtime *DockerRuntime) PullImage(image string) error

PullImage pulls the image

func (*DockerRuntime) StopContainer added in v1.7.0

func (runtime *DockerRuntime) StopContainer(containerID string) error

type KubeContainer added in v1.7.0

type KubeContainer struct {
	ID            string
	Namespace     string
	PodName       string
	ContainerName string
}

KubeContainer describes one Kubernetes-managed container discovered from the runtime.

Jump to

Keyboard shortcuts

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