types

package
v1.20.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CPUS_PER_EXECUTOR = 0.01
	CPUS_PER_TASK     = 1
	MEM_PER_EXECUTOR  = 64
	MEM_PER_TASK      = 64
	DISK_PER_EXECUTOR = 64
	DISK_PER_TASK     = 64
)

executor or task default resources limits

View Source
const (
	OPERATION_LAUNCH     = "LAUNCH"
	OPERATION_DELETE     = "DELETE"
	OPERATION_SCALE      = "SCALE"
	OPERATION_INNERSCALE = "INNERSCALE"
	OPERATION_ROLLBACK   = "ROLLBACK"
	OPERATION_RESCHEDULE = "RESCHEDULE"
	OPERATION_UPDATE     = "UPDATE"
)

operation operate

View Source
const (
	OPERATION_STATUS_INIT    = "INIT"
	OPERATION_STATUS_FINISH  = "FINISH"
	OPERATION_STATUS_FAIL    = "FAIL"
	OPERATION_STATUS_TIMEOUT = "TIMEOUT"
)

operation status

View Source
const (
	Daemonset_Status_Starting = "Starting"
	Daemonset_Status_Running  = "Running"
	Daemonset_Status_Abnormal = "Abnormal"
	Daemonset_Status_Deleting = "Deleting"
)

daemonset status

View Source
const (
	APP_STATUS_STAGING       = "Staging"
	APP_STATUS_DEPLOYING     = "Deploying"
	APP_STATUS_RUNNING       = "Running"
	APP_STATUS_FINISH        = "Finish"
	APP_STATUS_ERROR         = "Error"
	APP_STATUS_OPERATING     = "Operating"
	APP_STATUS_ROLLINGUPDATE = "RollingUpdate"
	APP_STATUS_UNKNOWN       = "Unknown"
	APP_STATUS_ABNORMAL      = "Abnormal"
)

app status

View Source
const (
	APP_STATUS_RUNNING_STR  = "application is running"
	APP_STATUS_ABNORMAL_STR = "application is abnormal"
)

app status

View Source
const (
	APP_SUBSTATUS_UNKNOWN            = "Unknown"
	APP_SUBSTATUS_ROLLINGUPDATE_DOWN = "RollingUpdateDown"
	APP_SUBSTATUS_ROLLINGUPDATE_UP   = "RollingUpdateUp"
)

app substatus

View Source
const (
	TASK_STATUS_STAGING  = "Staging"
	TASK_STATUS_STARTING = "Starting"
	TASK_STATUS_RUNNING  = "Running"
	TASK_STATUS_FINISH   = "Finish"
	TASK_STATUS_ERROR    = "Error"
	TASK_STATUS_KILLING  = "Killing"
	TASK_STATUS_KILLED   = "Killed"
	TASK_STATUS_FAIL     = "Failed"
	TASK_STATUS_LOST     = "Lost"

	TASK_STATUS_RESTARTING = "Restarting"

	TASK_STATUS_UNKOWN = "Unknown"
)

task status

View Source
const (
	TASKGROUP_STATUS_STAGING  = "Staging"
	TASKGROUP_STATUS_STARTING = "Starting"
	TASKGROUP_STATUS_RUNNING  = "Running"
	TASKGROUP_STATUS_FINISH   = "Finish"
	TASKGROUP_STATUS_ERROR    = "Error"
	TASKGROUP_STATUS_KILLING  = "Killing"
	TASKGROUP_STATUS_KILLED   = "Killed"
	TASKGROUP_STATUS_FAIL     = "Failed"
	TASKGROUP_STATUS_LOST     = "Lost"

	TASKGROUP_STATUS_RESTARTING = "Restarting"

	TASKGROUP_STATUS_UNKNOWN = "Unknown"
)

taskgroup status

View Source
const (
	TASK_TEMPLATE_KEY_FORMAT      = "${%s}"
	TASK_TEMPLATE_KEY_PORT_FORMAT = "ports.%s"
	TASK_TEMPLATE_KEY_PROCESSNAME = "processname"
	TASK_TEMPLATE_KEY_INSTANCEID  = "instanceid"
	TASK_TEMPLATE_KEY_HOSTIP      = "hostip"
	TASK_TEMPLATE_KEY_NAMESPACE   = "namespace"
	TASK_TEMPLATE_KEY_WORKPATH    = "workPath"
	TASK_TEMPLATE_KEY_PIDFILE     = "pidFile"
)
View Source
const (
	APP_TASK_TEMPLATE_KEY_FORMAT      = "${%s}"
	APP_TASK_TEMPLATE_KEY_PORT_FORMAT = "bcs.ports.%s"
	APP_TASK_TEMPLATE_KEY_APPNAME     = "bcs.appname"
	APP_TASK_TEMPLATE_KEY_INSTANCEID  = "bcs.instanceid"
	APP_TASK_TEMPLATE_KEY_HOSTIP      = "bcs.hostip"
	APP_TASK_TEMPLATE_KEY_NAMESPACE   = "bcs.namespace"
	APP_TASK_TEMPLATE_KEY_PODID       = "bcs.taskgroupid"
	APP_TASK_TEMPLATE_KEY_PODNAME     = "bcs.taskgroupname"
)
View Source
const (
	DEPLOYMENT_STATUS_DEPLOYING             = "Deploying"
	DEPLOYMENT_STATUS_RUNNING               = "Running"
	DEPLOYMENT_STATUS_ROLLINGUPDATE         = "Update"
	DEPLOYMENT_STATUS_ROLLINGUPDATE_PAUSED  = "UpdatePaused"
	DEPLOYMENT_STATUS_ROLLINGUPDATE_SUSPEND = "UpdateSuspend"
	DEPLOYMENT_STATUS_DELETING              = "Deleting"
)
View Source
const (
	DEPLOYMENT_OPERATION_NIL    = ""
	DEPLOYMENT_OPERATION_DELETE = "DELETE"
	DEPLOYMENT_OPERATION_START  = "START"
)
View Source
const (
	Msg_UNKNOWN_STR            string = "unknown"
	Msg_LOCALFILE_STR          string = "localfile"
	Msg_SIGNAL_STR             string = "signal"
	Msg_ENV_STR                string = "env"
	Msg_REMOTE_STR             string = "remote"
	Msg_SECRET_STR             string = "secret"
	Msg_TASK_STATUS_QUERY_STR  string = "task_status_query"
	Msg_ENV_REMOTE_STR         string = "env_remote"
	Msg_UPDATE_TASK_STR        string = "update_task"
	Msg_COMMIT_TASK_STR        string = "commit_task"
	Msg_RELOAD_TASK_STR        string = "reload_task"
	Msg_RESTART_TASK_STR       string = "restart_task"
	Msg_Req_COMMAND_TASK_STR   string = "request_command_task"
	Msg_Res_COMMAND_TASK_STR   string = "response_command_task"
	Msg_TASK_STATUS_UPDATE_STR string = "task_status_update"
)
View Source
const (
	//namespace
	MetricsNamespaceScheduler = "bkbcs"

	//subsystem
	MetricsSubsystemScheduler = "scheduler"
)
View Source
const (
	Ext_TaskState_TASK_RESTARTING int32 = 101
)

extension for TaskState_TASK_...

View Source
const (
	MesosAttributeNoSchedule = "NoSchedule"
)

Variables

This section is empty.

Functions

func GetRunAsAndAppIDbyTaskGroupID

func GetRunAsAndAppIDbyTaskGroupID(taskGroupId string) (string, string)

return namespace, appid

func GetRunAsAndAppIDbyTaskID

func GetRunAsAndAppIDbyTaskID(taskId string) (string, string)

return namespace, appid

func GetTaskGroupID

func GetTaskGroupID(taskID string) string

return taskgroupId by taskid

Types

type Agent

type Agent struct {
	Key          string
	LastSyncTime int64
	AgentInfo    *mesos_master.Response_GetAgents_Agent
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	ResourceVersion string `json:"-"`
}

mesos slave info

func (*Agent) DeepCopy

func (in *Agent) DeepCopy() *Agent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionWebhookConfigurationSpec.

func (*Agent) DeepCopyInto

func (in *Agent) DeepCopyInto(out *Agent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Agent) GetAgentIP

func (om *Agent) GetAgentIP() string

func (*Agent) GetAgentInfo

func (om *Agent) GetAgentInfo() *commtypes.BcsClusterAgentInfo

type AgentSchedInfo

type AgentSchedInfo struct {
	HostName   string  `json:"host_name"`
	DeltaCPU   float64 `json:"delta_cpu"`
	DeltaMem   float64 `json:"delta_mem"`
	DeltaDisk  float64 `json:"delta_disk"`
	Taskgroups map[string]*Resource
}

func (*AgentSchedInfo) DeepCopy

func (in *AgentSchedInfo) DeepCopy() *AgentSchedInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentSchedInfoSpec.

func (*AgentSchedInfo) DeepCopyInto

func (in *AgentSchedInfo) DeepCopyInto(out *AgentSchedInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Application

type Application struct {
	Kind             commtypes.BcsDataType
	ID               string
	Name             string
	ObjectMeta       commtypes.ObjectMeta
	DefineInstances  uint64
	Instances        uint64
	RunningInstances uint64
	RunAs            string
	ClusterId        string
	Status           string
	SubStatus        string
	LastStatus       string
	Created          int64
	UpdateTime       int64
	Mode             string
	LastUpdateTime   int64
	//we should replace the next three BcsXXX, using ObjectMeta.Labels directly
	//BcsAppID    string
	//BcsSetID    string
	//BcsModuleID string
	Message string
	Pods    []*commtypes.BcsPodIndex
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	ResourceVersion string `json:"-"`
}

Application for container

func (*Application) DeepCopy

func (in *Application) DeepCopy() *Application

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentSchedInfoSpec.

func (*Application) DeepCopyInto

func (in *Application) DeepCopyInto(out *Application)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Application) GetUuid

func (in *Application) GetUuid() string

type BCSTaskFailMsg

type BCSTaskFailMsg struct {
	Reason TaskFail_Reason
	Desc   string
}

type BcsDaemonset

type BcsDaemonset struct {
	commtypes.ObjectMeta `json:",inline"`
	Instances            uint64
	RunningInstances     uint64
	Status               string
	LastStatus           string
	Created              int64
	LastUpdateTime       int64
	//force delete daemonset
	ForceDeleting bool
	//key = taskgroup.ID
	Pods map[string]struct{}
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	ResourceVersion string `json:"-"`
}

Application for container

func (*BcsDaemonset) DeepCopy

func (in *BcsDaemonset) DeepCopy() *BcsDaemonset

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentSchedInfoSpec.

func (*BcsDaemonset) DeepCopyInto

func (in *BcsDaemonset) DeepCopyInto(out *BcsDaemonset)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BcsDaemonset) GetUuid

func (d *BcsDaemonset) GetUuid() string

get daemonset the unique uuid

type BcsDaemonsetDef

type BcsDaemonsetDef struct {
	commtypes.ObjectMeta `json:",inline"`
	Version              *Version `json:"version"`
}

type BcsMessage

type BcsMessage struct {
	Id          int64
	Type        *Msg_Type
	TaskGroupId string
	//if TaskID is null, message should be send to all tasks in same executor instance,
	//else if TaskID is not null, message should be sendto the task specialed by TaskID.
	TaskID              *mesos.TaskID
	Local               *Msg_LocalFile           `json:",omitempty"`
	Sig                 *Msg_Signal              `json:",omitempty"`
	Env                 *Msg_Env                 `json:",omitempty"`
	EnvRemote           *Msg_EnvRemote           `json:",omitempty"`
	Remote              *Msg_Remote              `json:",omitempty"`
	Secret              *Msg_Secret              `json:",omitempty"`
	TaskStatusQuery     *Msg_TaskStatusQuery     `json:",omitempty"`
	UpdateTaskResources *Msg_UpdateTaskResources `json:",omitempty"`
	CommitTask          *Msg_CommitTask          `json:",omitempty"`
	ReloadTask          *Msg_ReloadTasks         `json:",omitempty"`
	RestartTask         *Msg_RestartTasks        `json:",omitempty"`
	RequestCommandTask  *RequestCommandTask      `json:",omitempty"`
	ResponseCommandTask *ResponseCommandTask     `json:",omitempty"`
	TaskStatus          []byte                   `json:",omitempty"`

	Status MsgStatus_type
	//if status=failed, then message is failed info
	Message string
	//complete time
	CompleteTime int64
	CreateTime   int64
}

BcsMessage discribe msg from scheduler to executor by mesos MESSAGE call

type Check

type Check struct {
	ID          string   `json:"id"`
	Protocol    string   `json:"protocol"`
	Address     string   `json:"address"`
	Port        int      `json:"port"`
	Command     *Command `json:"command"`
	Path        string   `json:"path"`
	MaxFailures int      `json:"max_failures"`
	Interval    int      `json:"interval"`
	Timeout     int      `json:"timeout"`
	TaskID      string   `json:"task_id"`
	TaskGroupID string   `json:"taskgroup_id"`
	AppID       string   `json:"app_id"`
}

type Command

type Command struct {
	Value string
}

Command

type CommitTask

type CommitTask struct {
	TaskId *string
	Image  *string
}

type Container

type Container struct {
	Type          string
	Docker        *Docker
	Volumes       []*Volume
	Resources     *Resource
	LimitResoures *Resource
	//ExtendedResources []*commtypes.ExtendedResource
	DataClass *DataClass

	ConfigMaps []commtypes.ConfigMap
	Secrets    []commtypes.Secret

	HealthChecks []*commtypes.HealthCheck

	//network flow limit
	NetLimit *commtypes.NetLimit
}

Container for Version

type DataClass

type DataClass struct {
	//resources request cpu\memory
	Resources *Resource
	//resources limit cpu\memory
	LimitResources *Resource
	//extended resources, key=ExtendedResource.Name
	ExtendedResources []*commtypes.ExtendedResource
	Msgs              []*BcsMessage
	NetLimit          *commtypes.NetLimit
	//add for proc 20180730
	ProcInfo *ProcDef
}

func (*DataClass) DeepCopy

func (in *DataClass) DeepCopy() *DataClass

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataClass.

func (*DataClass) DeepCopyInto

func (in *DataClass) DeepCopyInto(out *DataClass)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Deployment

type Deployment struct {
	ObjectMeta      commtypes.ObjectMeta        `json:"metadata"`
	Selector        map[string]string           `json:"selector,omitempty"`
	Strategy        commtypes.UpgradeStrategy   `json:"strategy"`
	Status          string                      `json:"status"`
	Application     *DeploymentReferApplication `json:"application"`
	ApplicationExt  *DeploymentReferApplication `json:"application_ext"`
	LastRollingTime int64                       `json:"last_rolling_time"`
	CurrRollingOp   string                      `json:"curr_rolling_operation"`
	IsInRolling     bool                        `json:"is_in_rolling"`
	CheckTime       int64                       `json:"check_time"`
	Message         string                      `json:"message"`
	// BcsDeployment current original definition
	RawJson *commtypes.BcsDeployment `json:"raw_json,omitempty"`
	// BcsDeployment old version original definition
	RawJsonBackup *commtypes.BcsDeployment `json:"raw_json_backup,omitempty"`
}

func (*Deployment) DeepCopy

func (in *Deployment) DeepCopy() *Deployment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpec.

func (*Deployment) DeepCopyInto

func (in *Deployment) DeepCopyInto(out *Deployment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeploymentDef

type DeploymentDef struct {
	ObjectMeta commtypes.ObjectMeta      `json:"metadata"`
	Selector   map[string]string         `json:"selector,omitempty"`
	Version    *Version                  `json:"version"`
	Strategy   commtypes.UpgradeStrategy `json:"strategy"`
	// BcsDeployment original definition
	RawJson *commtypes.BcsDeployment `json:"raw_json,omitempty"`
}

type DeploymentReferApplication

type DeploymentReferApplication struct {
	ApplicationName         string `json:"name"`
	CurrentTargetInstances  int    `json:"curr_target_instances"`
	CurrentRollingInstances int    `josn:"curr_rolling_instances"`
}

type Docker

type Docker struct {
	Hostname        string
	ForcePullImage  bool
	Image           string
	ImagePullUser   string
	ImagePullPasswd string
	Network         string
	NetworkType     string
	Command         string
	Arguments       []string
	Parameters      []*Parameter
	PortMappings    []*PortMapping
	Env             map[string]string
	Privileged      bool
}

Docker for container

type Framework

type Framework struct {
	ID string `json:"id"`
}

mesos framework info

type MsgStatus_type

type MsgStatus_type string
const (
	Msg_Status_Staging MsgStatus_type = "staging"
	Msg_Status_Success MsgStatus_type = "success"
	Msg_Status_Failed  MsgStatus_type = "failed"
)

type Msg_CommitTask

type Msg_CommitTask struct {
	Tasks []*CommitTask
}

type Msg_Env

type Msg_Env struct {
	Name  *string
	Value *string
}

type Msg_EnvRemote

type Msg_EnvRemote struct {
	Name         *string
	From         *string
	Type         *string //http, https, ftp, ftps
	RemoteUser   *string
	RemotePasswd *string
}

type Msg_LocalFile

type Msg_LocalFile struct {
	To     *string
	Right  *string
	User   *string
	Base64 *string
}

Msg_BinFile discribe where the file should be save, and the

type Msg_ReloadTasks

type Msg_ReloadTasks struct {
}

type Msg_Remote

type Msg_Remote struct {
	To           *string
	Right        *string
	User         *string
	From         *string
	Type         *string //http, https, ftp, ftps
	RemoteUser   *string
	RemotePasswd *string
}

type Msg_RestartTasks

type Msg_RestartTasks struct {
}

type Msg_Secret

type Msg_Secret struct {
	Name  *string
	Value *string
	Type  *Secret_Type
}

type Msg_Signal

type Msg_Signal struct {
	Signal      *uint32
	ProcessName *string
}

type Msg_TaskStatusQuery

type Msg_TaskStatusQuery struct {
	Reason *string
}

type Msg_Type

type Msg_Type int32

Msg_Type Message discribe all msg from bcs scheduler to bcs executor Include binary file, text file, signal, env

const (
	Msg_UNKNOWN            Msg_Type = 0
	Msg_LOCALFILE          Msg_Type = 1
	Msg_SIGNAL             Msg_Type = 2
	Msg_ENV                Msg_Type = 3
	Msg_REMOTE             Msg_Type = 4
	Msg_SECRET             Msg_Type = 5
	Msg_TASK_STATUS_QUERY  Msg_Type = 6
	Msg_ENV_REMOTE         Msg_Type = 7
	Msg_UPDATE_TASK        Msg_Type = 8
	Msg_COMMIT_TASK        Msg_Type = 9
	Msg_RELOAD_TASK        Msg_Type = 10
	Msg_RESTART_TASK       Msg_Type = 11
	Msg_Req_COMMAND_TASK   Msg_Type = 12
	Msg_Res_COMMAND_TASK   Msg_Type = 13
	Msg_TASK_STATUS_UPDATE Msg_Type = 14
)

func (Msg_Type) Enum

func (x Msg_Type) Enum() *Msg_Type

type Msg_UpdateTaskResources

type Msg_UpdateTaskResources struct {
	Resources []*TaskResources
}

type Operation

type Operation struct {
	ID             string
	RunAs          string
	AppID          string
	OperationType  string
	Status         string
	CreateTime     int64
	LastUpdateTime int64
	ErrorStr       string
}

Operation for application

type OperationIndex

type OperationIndex struct {
	Operation string
}

type Parameter

type Parameter struct {
	Key   string
	Value string
}

Parameter for container

type PortMapping

type PortMapping struct {
	ContainerPort int32
	HostPort      int32
	Name          string
	Protocol      string
}

PortMapping for container

type ProcDef

type ProcDef struct {
	ProcName   string           `json:"procName"`
	WorkPath   string           `json:"workPath"`
	PidFile    string           `json:"pidFile"`
	StartCmd   string           `json:"startCmd"`
	CheckCmd   string           `json:"checkCmd"`
	StopCmd    string           `json:"stopCmd"`
	RestartCmd string           `json:"restartCmd"`
	ReloadCmd  string           `json:"reloadCmd"`
	KillCmd    string           `json:"killCmd"`
	LogPath    string           `json:"logPath"`
	CfgPath    string           `json:"cfgPath"`
	Uris       []*commtypes.Uri `json:"uris"`
	// seconds
	StartGracePeriod int `json:"startGracePeriod"`
}

func (*ProcDef) DeepCopy

func (in *ProcDef) DeepCopy() *ProcDef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProcDef.

func (*ProcDef) DeepCopyInto

func (in *ProcDef) DeepCopyInto(out *ProcDef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RequestCommandTask

type RequestCommandTask struct {
	ID          string   //id
	TaskId      string   //application taskid
	ContainerId string   //docker container id
	Env         []string //env
	Cmd         []string //command
	User        string   //user
	WorkingDir  string   //work dir
	Privileged  bool
}

type ReschedMesosAddress

type ReschedMesosAddress struct {
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`
	Port     int    `json:"port"`
}

mesos address

type ReschedMesosInfo

type ReschedMesosInfo struct {
	Address  ReschedMesosAddress `json:"address"`
	Hostname string              `json:"hostname"`
	Id       string              `json:"id"`
	IP       int                 `json:"ip"`
	Pid      string              `json:"pid"`
	Port     int                 `json:"port"`
	Version  string              `json:"version"`
}

mesos info

type Resource

type Resource struct {
	//cpu核数
	Cpus float64
	//MB
	Mem  float64
	Disk float64
}

Resource discribe resources needed by a task

func (*Resource) DeepCopy

func (in *Resource) DeepCopy() *Resource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionWebhookConfigurationSpec.

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResponseCommandTask

type ResponseCommandTask struct {
	ID          string //id
	TaskId      string //application taskid
	ContainerId string //container id
	Status      types.TaskCommandStatus
	Message     string
	CommInspect *types.CommandInspectInfo
}

type Secret_Type

type Secret_Type int32
const (
	Secret_Unknown Secret_Type = 0
	Secret_Env     Secret_Type = 1
	Secret_File    Secret_Type = 2
)

func (Secret_Type) Enum

func (x Secret_Type) Enum() *Secret_Type

type Task

type Task struct {
	Kind            commtypes.BcsDataType
	ID              string
	Name            string
	Hostame         string
	Command         string
	Arguments       []string
	Image           string
	ImagePullUser   string
	ImagePullPasswd string
	Network         string
	NetworkType     string
	PortMappings    []*PortMapping
	Privileged      bool
	Parameters      []*Parameter
	ForcePullImage  bool
	Volumes         []*Volume
	Env             map[string]string
	Labels          map[string]string
	DataClass       *DataClass
	//whether cpuset
	Cpuset       bool
	HealthChecks []*commtypes.HealthCheck
	// health check status
	HealthCheckStatus           []*commtypes.BcsHealthCheckStatus
	Healthy                     bool
	IsChecked                   bool
	ConsecutiveFailureTimes     uint32
	LocalMaxConsecutiveFailures uint32

	OfferId        string
	AgentId        string
	AgentHostname  string
	AgentIPAddress string
	Status         string
	LastStatus     string
	UpdateTime     int64
	StatusData     string
	AppId          string
	RunAs          string
	KillPolicy     *commtypes.KillPolicy
	Uris           []string
	LastUpdateTime int64
	Message        string
	//network flow limit
	NetLimit *commtypes.NetLimit
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	ResourceVersion string `json:"-"`
}

Task

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskSpec.

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskFail_Reason

type TaskFail_Reason int32
const (
	TaskFail_UNKOWN   TaskFail_Reason = 0
	TaskFail_IP_SHORT TaskFail_Reason = 1
	TaskFail_IP_USED  TaskFail_Reason = 2
)

type TaskGroup

type TaskGroup struct {
	Kind            commtypes.BcsDataType
	ID              string
	Name            string
	AppID           string
	RunAs           string
	ObjectMeta      commtypes.ObjectMeta
	AgentID         string
	ExecutorID      string
	Status          string
	LastStatus      string
	InstanceID      uint64
	Taskgroup       []*Task
	KillPolicy      *commtypes.KillPolicy
	RestartPolicy   *commtypes.RestartPolicy
	VersionName     string
	LastUpdateTime  int64
	Attributes      []*mesos.Attribute
	StartTime       int64
	UpdateTime      int64
	ReschededTimes  int
	LastReschedTime int64
	//we should replace the next three BcsXXX, using ObjectMeta.Labels directly
	//BcsAppID       string
	//BcsSetID       string
	//BcsModuleID    string
	HostName       string
	Message        string
	LaunchResource *Resource
	CurrResource   *Resource
	//BcsMessages map[int64]*BcsMessage
	BcsEventMsg *BcsMessage
	// Populated by the system.
	// Read-only.
	// Value must be treated as opaque by clients and .
	ResourceVersion string `json:"-"`
}

taskgroup describes the implements of multiple tasks

func (*TaskGroup) DeepCopy

func (in *TaskGroup) DeepCopy() *TaskGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskGroupSpec.

func (*TaskGroup) DeepCopyInto

func (in *TaskGroup) DeepCopyInto(out *TaskGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TaskGroup) GetAgentIp

func (t *TaskGroup) GetAgentIp() string

get taskgroup allocated node ip

func (*TaskGroup) GetExtendedResources

func (in *TaskGroup) GetExtendedResources() map[string]*commtypes.ExtendedResource

type TaskGroupOpResult

type TaskGroupOpResult struct {
	ID     string
	Status string
	Err    string
}

type TaskResources

type TaskResources struct {
	TaskId *string
	Cpu    *float64
	Mem    *float64
}

type Version

type Version struct {
	ID            string
	Name          string
	ObjectMeta    commtypes.ObjectMeta
	PodObjectMeta commtypes.ObjectMeta
	Instances     int32
	RunAs         string
	Container     []*Container
	//add  20180802
	Process       []*commtypes.Process
	Labels        map[string]string
	KillPolicy    *commtypes.KillPolicy
	RestartPolicy *commtypes.RestartPolicy
	Constraints   *commtypes.Constraint
	Uris          []string
	Ip            []string
	Mode          string
	// added  20181011, add for differentiate process/application
	Kind commtypes.BcsDataType
	// commtypes.ReplicaController json
	RawJson *commtypes.ReplicaController `json:"raw_json,omitempty"`
}

Version for api resources application or deployment

func (*Version) AllCpus

func (version *Version) AllCpus() float64

AllCpus return taskgroup will use cpu resources

func (*Version) AllDisk

func (version *Version) AllDisk() float64

AllDisk return taskgroup will use disk resources

func (*Version) AllMems

func (version *Version) AllMems() float64

AllMems return taskgroup will use memory resource

func (*Version) AllResource

func (version *Version) AllResource() *Resource

AllResource return taskgroup used cpu, memory, disk resources

func (*Version) CheckAndDefaultResource

func (version *Version) CheckAndDefaultResource() error

CheckAndDefaultResource check the resource of each container, if no resource, set default value

func (*Version) CheckConstraints

func (version *Version) CheckConstraints() bool

check application constraints whether is valid

func (*Version) DeepCopy

func (in *Version) DeepCopy() *Version

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskGroupSpec.

func (*Version) DeepCopyInto

func (in *Version) DeepCopyInto(out *Version)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Version) GetExtendedResources

func (in *Version) GetExtendedResources() map[string]*commtypes.ExtendedResource

type Volume

type Volume struct {
	ContainerPath string
	HostPath      string
	Mode          string
}

Volume for container

Jump to

Keyboard shortcuts

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