Documentation ¶
Index ¶
- Constants
- func NewPod(operator container.Container, tasks []*container.BcsContainerTask, ...) container.Pod
- type CNIPod
- func (p *CNIPod) CommitImage(id, image string) error
- func (p *CNIPod) Execute(name string, command []string) error
- func (p *CNIPod) Finit() error
- func (p *CNIPod) GetContainerByName(name string) *container.BcsContainerInfo
- func (p *CNIPod) GetContainerID() string
- func (p *CNIPod) GetContainerTasks() map[string]*container.BcsContainerTask
- func (p *CNIPod) GetContainers() []*container.BcsContainerInfo
- func (p *CNIPod) GetIPAddr() string
- func (p *CNIPod) GetMessage() string
- func (p *CNIPod) GetNamespace() string
- func (p *CNIPod) GetNetArgs() [][2]string
- func (p *CNIPod) GetNetStatus() string
- func (p *CNIPod) GetNetns() string
- func (p *CNIPod) GetNetworkName() string
- func (p *CNIPod) GetPid() int
- func (p *CNIPod) GetPodID() string
- func (p *CNIPod) GetPodStatus() container.PodStatus
- func (p *CNIPod) Init() error
- func (p *CNIPod) Injection() bool
- func (p *CNIPod) IsHealthy() bool
- func (p *CNIPod) SetIPAddr(ip string)
- func (p *CNIPod) SetPodID(ID string)
- func (p *CNIPod) Start() error
- func (p *CNIPod) Stop(graceExit int)
- func (p *CNIPod) UpdateResources(id string, resource *schedTypes.TaskResources) error
- func (p *CNIPod) UploadFile(name, source, dest string) error
Constants ¶
const ( BcsNetworkContainer = "BcsNetworkContainer" BcsNetworkContainerTrue = "true" BcsNetworkMode = "networkMode" )
const (
ContainerStatusAbnormal = 1
)
const (
PodNetEgressLimitName = "CTNR_NET_EGRESS_RATE"
)
Variables ¶
This section is empty.
Functions ¶
func NewPod ¶
func NewPod(operator container.Container, tasks []*container.BcsContainerTask, handler *container.PodEventHandler, netImage string, extendedResourceDriver *extendedresource.Driver) container.Pod
NewPod create CNIPod instance with container interaface and container info
Types ¶
type CNIPod ¶
type CNIPod struct { //container network flow limit args NetLimit *comtypes.NetLimit // contains filtered or unexported fields }
CNIPod combination for mutiple container
func (*CNIPod) CommitImage ¶
func (*CNIPod) GetContainerByName ¶
func (p *CNIPod) GetContainerByName(name string) *container.BcsContainerInfo
GetContainerByName get container info by container name
func (*CNIPod) GetContainerID ¶
GetContainerID get pod container id, in CNIPod, container id is network container id
func (*CNIPod) GetContainerTasks ¶
func (p *CNIPod) GetContainerTasks() map[string]*container.BcsContainerTask
func (*CNIPod) GetContainers ¶
func (p *CNIPod) GetContainers() []*container.BcsContainerInfo
GetContainers get all running container's info
func (*CNIPod) GetNetArgs ¶
func (*CNIPod) GetNetStatus ¶
GetNetStatus return network status
func (*CNIPod) GetNetworkName ¶
GetNetworkName netns name, like cni name or docker network name
func (*CNIPod) GetPodStatus ¶
GetPodStatus get pod status. see @PodStatus
func (*CNIPod) 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 (*CNIPod) UpdateResources ¶
func (p *CNIPod) UpdateResources(id string, resource *schedTypes.TaskResources) error
UpdateResources update resources of containers
func (*CNIPod) UploadFile ¶
UploadFile upload source file to container(name)