cnm

package
v1.25.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerStatusAbnormal abnormal definition
	ContainerStatusAbnormal = 1
)

Variables

This section is empty.

Functions

func NewPod

func NewPod(operator container.Container, tasks []*container.BcsContainerTask,
	handler *container.PodEventHandler, extendedResourceDriver *extendedresource.Driver) container.Pod

NewPod create CNIPod instance with container interaface and container info CNM pod implementation is defferent with cni pod.

Types

type DockerPod

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

DockerPod combination for mutiple container

func (*DockerPod) CommitImage

func (p *DockerPod) CommitImage(id, image string) error

CommitImage image commit

func (*DockerPod) Execute

func (p *DockerPod) Execute(name string, command []string) error

Execute execute command in container(name)

func (*DockerPod) Finit

func (p *DockerPod) Finit() error

Finit dockerpod finit, nothing to be release. keep it empty

func (*DockerPod) GetContainerByName

func (p *DockerPod) GetContainerByName(name string) *container.BcsContainerInfo

GetContainerByName get container info by container name

func (*DockerPod) GetContainerID

func (p *DockerPod) GetContainerID() string

GetContainerID get pod container id, in CNIPod, container id is network container id

func (*DockerPod) GetContainerTasks

func (p *DockerPod) GetContainerTasks() map[string]*container.BcsContainerTask

GetContainerTasks get local container task

func (*DockerPod) GetContainers

func (p *DockerPod) GetContainers() []*container.BcsContainerInfo

GetContainers get all running container's info

func (*DockerPod) GetIPAddr

func (p *DockerPod) GetIPAddr() string

GetIPAddr get pod ip address if exist

func (*DockerPod) GetMessage

func (p *DockerPod) GetMessage() string

GetMessage get pod status message

func (*DockerPod) GetNamespace

func (p *DockerPod) GetNamespace() string

GetNamespace get pod namespace

func (*DockerPod) GetNetArgs

func (p *DockerPod) GetNetArgs() [][2]string

GetNetArgs implementation

func (*DockerPod) GetNetStatus

func (p *DockerPod) GetNetStatus() string

GetNetStatus return network status

func (*DockerPod) GetNetns

func (p *DockerPod) GetNetns() string

GetNetns netns path, format like /proc/$pid/net/netns

func (*DockerPod) GetNetworkName

func (p *DockerPod) GetNetworkName() string

GetNetworkName netns name, like cni name or docker network name

func (*DockerPod) GetPid

func (p *DockerPod) GetPid() int

GetPid get pod pid, in CNIPod, pid come from network container

func (*DockerPod) GetPodID

func (p *DockerPod) GetPodID() string

GetPodID get pod id

func (*DockerPod) GetPodStatus

func (p *DockerPod) GetPodStatus() container.PodStatus

GetPodStatus get pod status. see @PodStatus

func (*DockerPod) Init

func (p *DockerPod) Init() error

Init init pod infrastructure, in cnipod, we need start container by @defaultNetworkImage first. we will create network depend on this cotainer. all other containers will share network info with network container

func (*DockerPod) Injection

func (p *DockerPod) Injection() bool

Injection check ip address is injected

func (*DockerPod) IsHealthy

func (p *DockerPod) IsHealthy() bool

IsHealthy check pod is healthy

func (*DockerPod) SetIPAddr

func (p *DockerPod) SetIPAddr(ip string)

SetIPAddr set ip addr for pod

func (*DockerPod) SetPodID

func (p *DockerPod) SetPodID(ID string)

SetPodID set pod id if needed

func (*DockerPod) Start

func (p *DockerPod) Start() error

Start Starting all containers

func (*DockerPod) Stop

func (p *DockerPod) Stop(graceExit int)

Stop stop all containers

func (*DockerPod) UpdateResources

func (p *DockerPod) UpdateResources(id string, resource *schedTypes.TaskResources) error

UpdateResources update CPU or MEM resource in runtime

func (*DockerPod) UploadFile

func (p *DockerPod) UploadFile(name, source, dest string) error

UploadFile upload source file to container(name)

Jump to

Keyboard shortcuts

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