Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) AppCount() (int, error)
- func (c *Cluster) AppExists(path string) bool
- func (c *Cluster) AppHealthy(path string) bool
- func (c *Cluster) GetNodes() ([]Node, error)
- func (c *Cluster) InstallDCOSClient() error
- func (c *Cluster) InstallMarathonApp(filepath string, sleep, duration time.Duration) (int, error)
- func (c *Cluster) InstallMarathonLB() error
- func (c *Cluster) NodeCount() (int, error)
- func (c *Cluster) PackageExists(name string) bool
- func (c *Cluster) Version() (string, error)
- func (c *Cluster) WaitForNodes(nodeCount int, sleep, duration time.Duration) bool
- func (c *Cluster) WaitOnReady(path string, sleep, duration time.Duration) bool
- type Container
- type Docker
- type HealthCheck
- type List
- type MarathonApp
- type Node
- type PortMap
- type UnreachableStrategy
- type UpgradeStrategy
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { AdminUsername string AgentFQDN string Connection *remote.Connection }
Cluster holds information on how to communicate with the the dcos instances
func NewCluster ¶
NewCluster returns a new cluster struct
func (*Cluster) AppExists ¶
AppExists queries the marathon app list to see if an app exists for a given path
func (*Cluster) AppHealthy ¶
AppHealthy returns true if the app is deployed and healthy
func (*Cluster) InstallDCOSClient ¶
InstallDCOSClient will download and place in the path the dcos client
func (*Cluster) InstallMarathonApp ¶
InstallMarathonApp will send the marathon.json file to the remote server and install it using the dcos cli
func (*Cluster) InstallMarathonLB ¶
InstallMarathonLB will setup a loadbalancer if one has not been created
func (*Cluster) PackageExists ¶
PackageExists retruns true if the package name is found when doing dcos package list
func (*Cluster) WaitForNodes ¶
WaitForNodes will return an false if the nodes never become healthy
type Docker ¶
type Docker struct { Image string `json:"image"` Network string `json:"network"` Priviledged bool `json:"priviledged"` ForcePullImage bool `json:"forcePullImage"` PortMappings []PortMap `json:"portMappings"` }
Docker tells what image is being deployed and its port mappings
type HealthCheck ¶
type HealthCheck struct { GracePeriodSeconds int `json:"gracePeriodSeconds"` IntervalSeconds int `json:"intervalSeconds"` TimeoutSeconds int `json:"timeoutSeconds"` MaxConsecutiveFailures int `json:"maxConsecutiveFailures"` PortIndex int `json:"portIndex"` Path string `json:"path"` Protocol string `json:"protocol"` IgnoreHTTP1xx bool `json:"ignoreHttp1xx"` }
HealthCheck contains the information needed to tell DCOS how to health check a given app
type MarathonApp ¶
type MarathonApp struct { ID string `json:"id"` Instances int `json:"instances"` CPUS float64 `json:"cpus"` Memory int `json:"mem"` Disk int `json:"disk"` GPUS int `json:"gpus"` BackoffSeconds int `json:"backoffSeconds"` BackoffFactor float64 `json:"backoffFactor"` MaxLaunchDelaySeconds int `json:"maxLaunchDelaySeconds"` RequirePorts bool `json:"requirePorts"` KillSelection string `json:"killSelection"` TaskHealthy int `json:"tasksHealthy"` TaskRunning int `json:"tasksRunning"` TaskStaged int `json:"tasksStaged"` TaskUnhealthy int `json:"tasksUnhealthy"` Container Container `json:"container"` HealthChecks []HealthCheck `json:"healthChecks"` UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy"` UnreachableStrategy UnreachableStrategy `json:"unreachableStrategy"` AcceptedResourceRoles []string `json:"acceptedResourceRoles"` Labels map[string]string `json:"labels"` }
MarathonApp is the parent struct for a marathon app declared as json
type Node ¶
type Node struct { Host string `json:"host_ip"` Health int `json:"health"` Role string `json:"role"` }
Node represents a node object returned from querying the v1/nodes api
type PortMap ¶
type PortMap struct { Name string `json:"name"` ContainerPort int `json:"containerPort"` HostPort int `json:"hostPort"` ServicePort int `json:"servicePort"` Protocol string `json:"protocol"` }
PortMap is how the ports are exposed to the system and container
type UnreachableStrategy ¶
type UnreachableStrategy struct { InactiveAfterSeconds int `json:"inactiveAfterSeconds"` ExpungeAfterSeconds int `json:"expungeAfterSeconds"` }
UnreachableStrategy tells how long to wait if an instance isnt reachable
type UpgradeStrategy ¶
type UpgradeStrategy struct { MinimumHealthCapacity int `json:"minimumHealthCapacity"` MaximumOverCapacity int `json:"maximumOverCapacity"` }
UpgradeStrategy holds how many instances can be up or down during an upgrade
type Version ¶
type Version struct {
Version string `json:"version"`
}
Version holds response from calling http://localhost:80/dcos-metadata/dcos-version.json