Documentation
¶
Index ¶
- Constants
- func AND(ss ...string) *andrule
- type App
- type AppContainer
- type AppContainerDocker
- type AppContainerDockerParameter
- type AppContainerPortMapping
- type AppContainerVolume
- type AppCounts
- type AppDeployment
- type AppDeployments
- type AppFetch
- type AppGet
- type AppHealthCheck
- type AppHealthCheckCommand
- type AppIpAddress
- type AppIpAddressDiscovery
- type AppIpAddressDiscoveryPort
- type AppNetwork
- type AppPortDefinition
- type AppReadinessCheck
- type AppSecret
- type AppStatus
- type AppTasks
- type AppUpgradeStrategy
- type Constraint
- type Constraints
- type Deployment
- type Deployments
- type GetErrorResponse
- type Group
- type GroupHTTPResult
- type GroupPutResponse
- type GroupPutResponseDeployment
- type GroupPutResponseDetail
- type HealthCheckResult
- type InstanceIpAddr
- type MIpas
- type Marathon
- func (m *Marathon) Cancel(ctx context.Context, specObj interface{}) (interface{}, error)
- func (m *Marathon) CapacityInfo() apistructs.CapacityInfoData
- func (*Marathon) CleanUpBeforeDelete()
- func (m *Marathon) Create(ctx context.Context, specObj interface{}) (interface{}, error)
- func (m *Marathon) Destroy(ctx context.Context, specObj interface{}) error
- func (m *Marathon) Inspect(ctx context.Context, specObj interface{}) (interface{}, error)
- func (*Marathon) JobVolumeCreate(ctx context.Context, spec interface{}) (string, error)
- func (*Marathon) KillPod(podname string) error
- func (m *Marathon) Kind() executortypes.Kind
- func (m *Marathon) Name() executortypes.Name
- func (m *Marathon) Precheck(ctx context.Context, specObj interface{}) (apistructs.ServiceGroupPrecheckData, error)
- func (m *Marathon) Remove(ctx context.Context, specObj interface{}) error
- func (m *Marathon) ResourceInfo(brief bool) (apistructs.ClusterResourceInfoData, error)
- func (*Marathon) Scale(ctx context.Context, spec interface{}) (interface{}, error)
- func (m *Marathon) SetNodeLabels(setting executortypes.NodeLabelSetting, hosts []string, ...) error
- func (m *Marathon) Status(ctx context.Context, specObj interface{}) (apistructs.StatusDesc, error)
- func (m *Marathon) SuspendApp(ch chan string)
- func (m *Marathon) Update(ctx context.Context, specObj interface{}) (interface{}, error)
- func (m *Marathon) WaitEvent(options map[string]string, monitor bool, killedInstanceCh chan string, ...)
- type MarathonInstanceHealthChangedEvent
- type MarathonStatusUpdateEvent
- type ProcessedOffersSummary
- type Queue
- type QueueHTTPResult
- type QueueOffer
- type QueueOfferDelay
- type RejectSummaryLastOffer
- type ShortApp
- type Task
- type Ver
Constants ¶
const ( // The key of the oversold ratio in the configuration CPU_SUBSCRIBE_RATIO = "CPU_SUBSCRIBE_RATIO" // 100000 /sys/fs/cgroup/cpu/cpu.cfs_period_us default value CPU_CFS_PERIOD_US int = 100000 // Minimum application cpu value MIN_CPU_SIZE = 0.1 HCMethodCommand = "COMMAND" HCMethodTCP = "TCP" )
const ( PERIOD = 60 TIMES = 3 PROTECTION = 600 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Id string `json:"id"`
Cmd string `json:"cmd,omitempty"`
Args []string `json:"args,omitempty"`
User string `json:"user,omitempty"`
Instances int `json:"instances"`
Cpus float64 `json:"cpus"`
Mem float64 `json:"mem"`
Disk float64 `json:"disk"`
Container AppContainer `json:"container"`
Dependencies []string `json:"dependencies"`
Env map[string]string `json:"env,omitempty"`
Executor string `json:"executor,omitempty"`
AcceptedResourceRoles []string `json:"acceptedResourceRoles,omitempty"`
Constraints []Constraint `json:"constraints,omitempty"`
Uris []string `json:"uris,omitempty"`
Fetch []AppFetch `json:"fetch,omitempty"`
Secrets map[string]AppSecret `json:"secrets,omitempty"`
// Since: 1.5
Networks []AppNetwork `json:"networks,omitempty"`
// Deprecated: >= 1.5
IpAddress *AppIpAddress `json:"ipAddress,omitempty"`
Ports []int `json:"ports"`
RequirePorts bool `json:"requirePorts,omitempty"`
PortDefinition []AppPortDefinition `json:"portDefinitions,omitempty"`
UpgradeStrategy *AppUpgradeStrategy `json:"upgradeStrategy,omitempty"`
BackoffSeconds int `json:"backoffSeconds"`
BackoffFactor float32 `json:"backoffFactor"`
MaxLaunchDelaySeconds int `json:"maxLaunchDelaySeconds"`
TaskKillGracePeriodSeconds int `json:"taskKillGracePeriodSeconds,omitempty"`
HealthChecks []AppHealthCheck `json:"healthChecks"`
ReadinessChecks []AppReadinessCheck `json:"readinessChecks,omitempty"`
Labels map[string]string `json:"labels"`
Tty bool `json:"tty,omitempty"`
AppTasks
AppCounts
AppDeployments
}
type AppContainer ¶
type AppContainer struct {
Type string `json:"type,omitempty"`
Docker AppContainerDocker `json:"docker,omitempty"`
// Since: 1.5
PortMappings []AppContainerPortMapping `json:"portMappings,omitempty"`
Volumes []AppContainerVolume `json:"volumes,omitempty"`
}
type AppContainerDocker ¶
type AppContainerDocker struct {
ForcePullImage bool `json:"forcePullImage,omitempty"`
Image string `json:"image"`
Parameters []AppContainerDockerParameter `json:"parameters,omitempty"`
Privileged bool `json:"privileged,omitempty"`
// Deprecated: >=1.5
Network string `json:"network,omitempty"`
// Deprecated: >= 1.5
PortMappings []AppContainerPortMapping `json:"portMappings"`
}
type AppContainerPortMapping ¶
type AppContainerVolume ¶
type AppContainerVolume struct {
Mode string `json:"mode,omitempty"`
ContainerPath string `json:"containerPath,omitempty"`
HostPath string `json:"hostPath,omitempty"`
// TODO: refactor it
Persistent *apistructs.PersistentVolume `json:"persistent,omitempty"`
}
type AppDeployment ¶
type AppDeployment struct {
Id string `json:"id"`
}
type AppDeployments ¶
type AppDeployments struct {
Deployments []AppDeployment `json:"deployments"`
}
type AppHealthCheck ¶
type AppHealthCheck struct {
GracePeriodSeconds int `json:"gracePeriodSeconds"`
IgnoreHttp1xx bool `json:"ignoreHttp1xx,omitempty"`
IntervalSeconds int `json:"intervalSeconds,omitempty"`
MaxConsecutiveFailures int `json:"maxConsecutiveFailures,omitempty"`
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
DelaySeconds int `json:"delaySeconds"`
Protocol string `json:"protocol,omitempty"`
Path string `json:"path,omitempty"`
PortIndex int `json:"portIndex,omitempty"`
Port int `json:"port,omitempty"`
Command *AppHealthCheckCommand `json:"command,omitempty"`
}
type AppHealthCheckCommand ¶
type AppHealthCheckCommand struct {
Value string `json:"value,omitempty"`
}
type AppIpAddress ¶
type AppIpAddress struct {
NetworkName string `json:"networkName"`
Discovery AppIpAddressDiscovery `json:"discovery"`
Groups []string `json:"groups"`
Labels map[string]string `json:"labels"`
}
type AppIpAddressDiscovery ¶
type AppIpAddressDiscovery struct {
Ports []AppIpAddressDiscoveryPort `json:"ports"`
}
type AppNetwork ¶
type AppPortDefinition ¶
type AppReadinessCheck ¶
type AppReadinessCheck struct {
Name string `json:"name,omitempty"`
Protocol string `json:"protocol,omitempty"`
Path string `json:"path,omitempty"`
PortName string `json:"portName,omitempty"`
IntervalSeconds int `json:"intervalSeconds,omitempty"`
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
HttpStatusCodesForReady []int `json:"httpStatusCodesForReady,omitempty"`
PreserveLastResponse bool `json:"preserveLastResponse,omitempty"`
}
type AppTasks ¶
type AppTasks struct {
Tasks []Task `json:"tasks,omitempty"`
}
To get every instance info in one app
type AppUpgradeStrategy ¶
type Constraint ¶
type Constraint []string
func (Constraint) Equal ¶
func (c Constraint) Equal(other Constraint) bool
type Constraints ¶
type Constraints struct {
// contains filtered or unexported fields
}
Constraints Used to build & generate marathon constraints label
func (*Constraints) Generate ¶
func (c *Constraints) Generate() []Constraint
Generate Generate Marathon label
func (*Constraints) NewLikeRule ¶
func (c *Constraints) NewLikeRule(tag string) *rule
NewLikeRule add like rule
func (*Constraints) NewUnlikeRule ¶
func (c *Constraints) NewUnlikeRule(tag string) *rule
NewUnlikeRule add unlike rule
type Deployment ¶
type Deployments ¶
type Deployments []Deployment
type GetErrorResponse ¶
type GetErrorResponse struct {
Message string `json:"message,omitempty"`
}
type GroupHTTPResult ¶
type GroupHTTPResult struct {
Group
GetErrorResponse
}
wrap correct response and error
type GroupPutResponse ¶
type GroupPutResponse struct {
DeploymentId string `json:"deploymentId,omitempty"`
Version string `json:"version,omitempty"`
Message string `json:"message,omitempty"`
Details []GroupPutResponseDetail `json:"details,omitempty"`
Deployments []GroupPutResponseDeployment `json:"deployments,omitempty"`
}
func (*GroupPutResponse) ToString ¶
func (g *GroupPutResponse) ToString() string
type GroupPutResponseDeployment ¶
type GroupPutResponseDeployment struct {
Id string `json:"id,omitempty"`
}
type GroupPutResponseDetail ¶
type HealthCheckResult ¶
type HealthCheckResult struct {
Alive bool `json:"alive,omitempty"`
}
type InstanceIpAddr ¶
type InstanceIpAddr struct {
InstanceIp string `json:"ipAddress,omitempty"`
}
type Marathon ¶
type Marathon struct {
// contains filtered or unexported fields
}
func (*Marathon) CapacityInfo ¶
func (m *Marathon) CapacityInfo() apistructs.CapacityInfoData
func (*Marathon) CleanUpBeforeDelete ¶
func (*Marathon) CleanUpBeforeDelete()
func (*Marathon) JobVolumeCreate ¶
func (*Marathon) Kind ¶
func (m *Marathon) Kind() executortypes.Kind
func (*Marathon) Name ¶
func (m *Marathon) Name() executortypes.Name
func (*Marathon) Precheck ¶
func (m *Marathon) Precheck(ctx context.Context, specObj interface{}) (apistructs.ServiceGroupPrecheckData, error)
func (*Marathon) ResourceInfo ¶
func (m *Marathon) ResourceInfo(brief bool) (apistructs.ClusterResourceInfoData, error)
func (*Marathon) SetNodeLabels ¶
func (m *Marathon) SetNodeLabels(setting executortypes.NodeLabelSetting, hosts []string, labels map[string]string) error
func (*Marathon) Status ¶
func (m *Marathon) Status(ctx context.Context, specObj interface{}) (apistructs.StatusDesc, error)
func (*Marathon) SuspendApp ¶
Monitor instances that have been killed multiple times within a period of time, and the service to which the instance belongs will be sent here to be executed
func (*Marathon) Update ¶
Update update marathon group NOTE: If HOST_UNIQUE=true in the updated servicegroup, return an error directly Because after updating the group, the original host may no longer meet the current constraints. And re-obtaining the available host like create will invalidate the blue-green release of the service
func (*Marathon) WaitEvent ¶
func (m *Marathon) WaitEvent(options map[string]string, monitor bool, killedInstanceCh chan string, stopCh chan struct{})
TODO: Re-establish connections in consideration of marathon cluster restarts, exceptions, etc. TODO: Regularly obtain status from marathon api (implemented by aggregation computing layer)
type ProcessedOffersSummary ¶
type ProcessedOffersSummary struct {
RejectSummaryLastOffers []RejectSummaryLastOffer `json:"rejectSummaryLastOffers,omitempty"`
}
ProcessedOffersSummary Briefly describe whether the offer is in compliance
type Queue ¶
type Queue struct {
Queue []QueueOffer `json:"queue,omitempty"`
}
type QueueHTTPResult ¶
type QueueHTTPResult struct {
Queue
GetErrorResponse
}
wrap correct response and error
type QueueOffer ¶
type QueueOffer struct {
Count int `json:"count,omitempty"`
Delay QueueOfferDelay `json:"delay,omitempty"`
App App `json:"app,omitempty"`
// Overview of offer processing
ProcessedOffersSummary ProcessedOffersSummary `json:"processedOffersSummary,omitempty"`
}
type QueueOfferDelay ¶
type RejectSummaryLastOffer ¶
type RejectSummaryLastOffer struct {
Reason string `json:"reason,omitempty"`
Declined int `json:"declined,omitempty"`
Processed int `json:"processed,omitempty"`
}
RejectSummaryLastOffer Describe the failure of the recent offer
type Task ¶
type Task struct {
Id string `json:"id,omitempty"`
State string `json:"state,omitempty"`
InstanceIpAddresses []InstanceIpAddr `json:"ipAddresses,omitempty"`
Host string `json:"host,omitempty"`
HealthCheckResults []HealthCheckResult `json:"healthCheckResults,omitempty"`
}