Documentation ¶
Index ¶
- Constants
- func NewPod(operator container.Container, tasks []*container.BcsContainerTask, ...) container.Pod
- type DockerPod
- func (p *DockerPod) CommitImage(id, image string) error
- func (p *DockerPod) Execute(name string, command []string) error
- func (p *DockerPod) Finit() error
- func (p *DockerPod) GetContainerByName(name string) *container.BcsContainerInfo
- func (p *DockerPod) GetContainerID() string
- func (p *DockerPod) GetContainerTasks() map[string]*container.BcsContainerTask
- func (p *DockerPod) GetContainers() []*container.BcsContainerInfo
- func (p *DockerPod) GetIPAddr() string
- func (p *DockerPod) GetMessage() string
- func (p *DockerPod) GetNamespace() string
- func (p *DockerPod) GetNetArgs() [][2]string
- func (p *DockerPod) GetNetStatus() string
- func (p *DockerPod) GetNetns() string
- func (p *DockerPod) GetNetworkName() string
- func (p *DockerPod) GetPid() int
- func (p *DockerPod) GetPodID() string
- func (p *DockerPod) GetPodStatus() container.PodStatus
- func (p *DockerPod) Init() error
- func (p *DockerPod) Injection() bool
- func (p *DockerPod) IsHealthy() bool
- func (p *DockerPod) SetIPAddr(ip string)
- func (p *DockerPod) SetPodID(ID string)
- func (p *DockerPod) Start() error
- func (p *DockerPod) Stop(graceExit int)
- func (p *DockerPod) UpdateResources(id string, resource *schedTypes.TaskResources) error
- func (p *DockerPod) UploadFile(name, source, dest string) error
Constants ¶
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 ¶
CommitImage image commit
func (*DockerPod) GetContainerByName ¶
func (p *DockerPod) GetContainerByName(name string) *container.BcsContainerInfo
GetContainerByName get container info by container name
func (*DockerPod) GetContainerID ¶
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) GetMessage ¶
GetMessage get pod status message
func (*DockerPod) GetNamespace ¶
GetNamespace get pod namespace
func (*DockerPod) GetNetArgs ¶
GetNetArgs implementation
func (*DockerPod) GetNetStatus ¶
GetNetStatus return network status
func (*DockerPod) GetNetworkName ¶
GetNetworkName netns name, like cni name or docker network name
func (*DockerPod) GetPodStatus ¶
GetPodStatus get pod status. see @PodStatus
func (*DockerPod) Init ¶
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) UpdateResources ¶
func (p *DockerPod) UpdateResources(id string, resource *schedTypes.TaskResources) error
UpdateResources update CPU or MEM resource in runtime
func (*DockerPod) UploadFile ¶
UploadFile upload source file to container(name)