plugin

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitTimeout            = 10
	ContainerName          = "ampagent"
	ImageName              = "appcelerator/ampagent"
	DockerSocket           = "/var/run/docker.sock"
	DockerSwarmSocket      = "/var/run/docker"
	CoreStackName          = "amp"
	MaxMapCountRequirement = 262144 // as specified here: https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
)

Variables

View Source
var (
	ContainerLabels = map[string]string{"io.amp.role": "infrastructure"}
)

Functions

func CheckPrerequisites added in v0.18.0

func CheckPrerequisites(opts *RequestOptions) error

Check prerequisites

func DeleteCluster

func DeleteCluster(ctx context.Context, c *docker.Client, opts *RequestOptions) error

DeleteSwarm starts the delete operation

func EnsureSwarmExists

func EnsureSwarmExists(ctx context.Context, c *docker.Client, opts *RequestOptions) error

EnsureSwarmExists checks that the Swarm is initialized, and does it if it's not the case

func InfoAMPCore

func InfoAMPCore(ctx context.Context, c *docker.Client) (int, error)

InfoAMPCore returns the number of AMP core services

func InfoCluster

func InfoCluster(ctx context.Context, c *docker.Client) (swarm.Swarm, error)

InfoCluster returns the Swarm info

func InfoNode

func InfoNode(ctx context.Context, c *docker.Client) (swarm.Node, error)

InfoNode returns the Node info

func InfoToJSON

func InfoToJSON(status string, csCount int, usCount int) (string, error)

func InfoUser

func InfoUser(ctx context.Context, c *docker.Client) (int, error)

InfoUser returns the number of user services

func LabelNode

func LabelNode(ctx context.Context, c *docker.Client, opts *RequestOptions) error

func RunAgent

func RunAgent(ctx context.Context, c *docker.Client, action string, opts *RequestOptions) error

RunAgent runs the ampagent image to init (action ="install") or destroy (action="uninstall")

func SwarmNodeStatus

func SwarmNodeStatus(c *docker.Client) (swarm.LocalNodeState, error)

SwarmNodeStatus returns the swarm status for this node

Types

type FullSwarmInfo

type FullSwarmInfo struct {
	Swarm swarm.Swarm
	Node  swarm.Node
}

type RequestOptions

type RequestOptions struct {
	InitRequest swarm.InitRequest
	// Node labels
	Labels map[string]string
	// Tag of the ampagent image
	Tag           string
	Registration  string
	Notifications bool
	ForceLeave    bool
	NoLogs        bool
	NoMetrics     bool
	NoProxy       bool
	NoRollback    bool
}

RequestOptions stores parameters for the Docker API

type ShortSwarmInfo

type ShortSwarmInfo struct {
	SwarmStatus  string `json:"Swarm Status"`
	CoreServices int    `json:"Core Services"`
	UserServices int    `json:"User Services"`
}

Jump to

Keyboard shortcuts

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