kube

package
v0.9.310 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRI-O
	CRIO_CONTAINER_TYPE    = "io.kubernetes.cri-o.ContainerType"
	CRIO_IMAGE_NAME        = "io.kubernetes.cri-o.ImageName"
	CRIO_SANDBOX_NAMESPACE = "io.kubernetes.pod.namespace"
	CRIO_SANDBOX_NAME      = "io.kubernetes.pod.name"
	CRIO_CONTAINER_NAME    = "io.kubernetes.container.name"
	CRIO_SANDBOX_ID        = "io.kubernetes.cri-o.SandboxID"
	CRIO_LOG_DIRECTORY     = "io.kubernetes.cri-o.LogPath"

	// CRI
	CONTAINER_TYPE    = "io.kubernetes.cri.container-type"
	SANDBOX_ID        = "io.kubernetes.cri.sandbox-id"
	SANDBOX_NAME      = "io.kubernetes.cri.sandbox-name"
	SANDBOX_NAMESPACE = "io.kubernetes.cri.sandbox-namespace"
	SANDBOX_UID       = "io.kubernetes.cri.sandbox-uid"
	LOG_DIRECTORY     = "io.kubernetes.cri.sandbox-log-directory"

	// Kube container only annotation keys
	CONTAINER_NAME     = "io.kubernetes.cri.container-name"
	IMAGE_NAME         = "io.kubernetes.cri.image-name"
	SANDBOX_IMAGE_NAME = "io.kubernetes.cri.podsandbox.image-name"
)

Kube default sandbox annotation keys

View Source
const (
	CONTAINER_TYPE_CONTAINER = "container"
	CONTAINER_TYPE_SANDBOX   = "sandbox"
)

Variables

This section is empty.

Functions

func GetFirstNonEmptyAnnotation added in v0.9.278

func GetFirstNonEmptyAnnotation(annotations map[string]string, keys ...string) string

Types

type ContainerdClient added in v0.9.278

type ContainerdClient struct{}

Implements the K8s runtime client interface for Containerd

func NewContainerdClient added in v0.9.278

func NewContainerdClient() (*ContainerdClient, error)

func (*ContainerdClient) Query added in v0.9.285

func (c *ContainerdClient) Query(ctx context.Context, req *daemon.QueryReq) (resp *daemon.QueryResp, err error)

func (*ContainerdClient) String added in v0.9.278

func (c *ContainerdClient) String() string

type CrioClient added in v0.9.278

type CrioClient struct {
	RuntimeClientUnimplemented
}

func NewCrioClient added in v0.9.278

func NewCrioClient() (*CrioClient, error)

func (*CrioClient) String added in v0.9.278

func (c *CrioClient) String() string

type PodInfo added in v0.9.278

type PodInfo struct {
	ID          string
	Name        string
	Namespace   string
	UID         string
	Image       string
	Env         []string
	Annotations map[string]string
	Type        string
}

func PodInfoFromRunc added in v0.9.278

func PodInfoFromRunc(spec *specs.Spec) (*PodInfo, error)

PodInfoFromRunc extracts PodInfo from a container spec

type RuntimeClient added in v0.9.278

type RuntimeClient interface {
	String() string
	Query(context.Context, *daemon.QueryReq) (*daemon.QueryResp, error)
}

RuntimeClient is the interface that K8s runtime clients must implement

func CurrentRuntimeClient added in v0.9.278

func CurrentRuntimeClient() (RuntimeClient, error)

CurrentRuntimeClient returns the current K8s runtime client in use on this host.

type RuntimeClientUnimplemented added in v0.9.278

type RuntimeClientUnimplemented struct{}

Embed this struct into unimplemented runtime clients

func (*RuntimeClientUnimplemented) Query added in v0.9.285

func (*RuntimeClientUnimplemented) String added in v0.9.278

func (c *RuntimeClientUnimplemented) String() string

Jump to

Keyboard shortcuts

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