ec2

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2017 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Ec2Instances is a slice of EC2 instances types:
	Ec2Instances = []string{
		"c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "c3.large", "c3.xlarge", "cc2.8xlarge",
		"cg1.4xlarge", "d2.2xlarge", "d2.4xlarge", "d2.8xlarge", "d2.xlarge", "g2.2xlarge",
		"g2.8xlarge", "hi1.4xlarge", "hs1.8xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge",
		"i2.xlarge", "m3.2xlarge", "m3.large", "m3.medium", "m3.xlarge", "r3.2xlarge",
		"r3.4xlarge", "r3.8xlarge", "r3.large", "r3.xlarge", "x1.32xlarge"}

	// Ec2Regions is a slice of EC2 regions:
	Ec2Regions = []string{
		"us-east-1", "us-west-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-northeast-1",
		"ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "sa-east-1"}

	// Ec2Zones is a slice of EC2 zones:
	Ec2Zones = []string{
		"a", "b", "c", "d"}
)

Functions

func RunCmd

func RunCmd(cmd string) bool

RunCmd runs the cmd if owned by this package.

Types

type Data

type Data struct {
	Instance
	State
	// contains filtered or unexported fields
}

Data struct for EC2 endpoints, instance and state data.

func (*Data) Add

func (d *Data) Add()

Add a new instance to the cluster.

func (*Data) Deploy

func (d *Data) Deploy()

Deploy Kato's infrastructure on Amazon EC2.

func (*Data) Run

func (d *Data) Run()

Run uses EC2 API to launch a new instance.

func (*Data) Setup

func (d *Data) Setup()

Setup VPC, IAM and EC2 components.

type Instance

type Instance struct {
	AmiID        string `json:"AmiID"`        // deploy | add | run
	HostName     string `json:"HostName"`     //        | add |
	HostID       string `json:"HostID"`       //        | add |
	Roles        string `json:"Roles"`        //        | add |
	ClusterState string `json:"ClusterState"` //        | add |
	InstanceType string `json:"InstanceType"` //        | add | run
	SrcDstCheck  string `json:"SrcDstCheck"`  //        |     | run
	InstanceID   string `json:"InstanceID"`   //        |     | run
	SubnetID     string `json:"SubnetID"`     //        |     | run
	SecGrpIDs    string `json:"SecGrpIDs"`    //        |     | run
	PublicIP     string `json:"PublicIP"`     //        |     | run
	PrivateIP    string `json:"PrivateIP"`    //        |     | run
	IAMRole      string `json:"IAMRole"`      //        |     | run
	InterfaceID  string `json:"InterfaceID"`  //        |     | run
	ELBName      string `json:"ELBName"`      //        |     | run
	TagName      string `json:"TagName"`      //        |     | run
}

Instance data.

type State

type State struct {
	Quadruplets      []string `json:"-"`                // deploy |       | add |
	StubZones        []string `json:"StubZones"`        // deploy |       | add |
	QuorumCount      int      `json:"QuorumCount"`      // deploy |       | add |
	MasterCount      int      `json:"MasterCount"`      // deploy |       | add |
	CoreOSChannel    string   `json:"CoreOSChannel"`    // deploy |       | add |
	EtcdToken        string   `json:"EtcdToken"`        // deploy |       | add |
	DNSProvider      string   `json:"DNSProvider"`      // deploy |       | add |
	DNSApiKey        string   `json:"DNSApiKey"`        // deploy |       | add |
	SysdigAccessKey  string   `json:"SysdigAccessKey:"` // deploy |       | add |
	DatadogAPIKey    string   `json:"DatadogAPIKey:"`   // deploy |       | add |
	SlackWebhook     string   `json:"SlackWebhook:"`    // deploy |       | add |
	SMTPURL          string   `json:"SMTPURL:"`         // deploy |       | add |
	AdminEmail       string   `json:"AdminEmail:"`      // deploy |       | add |
	CaCertPath       string   `json:"CaCertPath"`       // deploy |       | add |
	CalicoIPPool     string   `json:"CalicoIPPool"`     // deploy |       |     |
	Domain           string   `json:"Domain"`           // deploy | setup | add |
	ClusterID        string   `json:"ClusterID"`        // deploy | setup | add |
	Region           string   `json:"Region"`           // deploy | setup | add | run
	Zone             string   `json:"Zone"`             // deploy | setup | add | run
	VpcCidrBlock     string   `json:"VpcCidrBlock"`     // deploy | setup |     |
	IntSubnetCidr    string   `json:"IntSubnetCidr"`    // deploy | setup |     |
	ExtSubnetCidr    string   `json:"ExtSubnetCidr"`    // deploy | setup |     |
	AllocationID     string   `json:"AllocationID"`     //        | setup |     | run
	VpcID            string   `json:"VpcID"`            //        | setup |     |
	MainRouteTableID string   `json:"MainRouteTableID"` //        | setup |     |
	InetGatewayID    string   `json:"InetGatewayID"`    //        | setup |     |
	NatGatewayID     string   `json:"NatGatewayID"`     //        | setup |     |
	RouteTableID     string   `json:"RouteTableID"`     //        | setup |     |
	KatoRoleID       string   `json:"KatoRoleID"`       //        | setup |     |
	RexrayPolicy     string   `json:"RexrayPolicy"`     //        | setup |     |
	QuorumSecGrp     string   `json:"QuorumSecGrp"`     //        | setup |     |
	MasterSecGrp     string   `json:"MasterSecGrp"`     //        | setup |     |
	WorkerSecGrp     string   `json:"WorkerSecGrp"`     //        | setup |     |
	BorderSecGrp     string   `json:"BorderSecGrp"`     //        | setup |     |
	ELBSecGrp        string   `json:"ELBSecGrp"`        //        | setup |     |
	IntSubnetID      string   `json:"IntSubnetID"`      //        | setup |     |
	ExtSubnetID      string   `json:"ExtSubnetID"`      //        | setup |     |
	DNSName          string   `json:"DNSName"`          //        | setup |     |
	KeyPair          string   `json:"KeyPair"`          //        |       | add | run
}

State data.

Jump to

Keyboard shortcuts

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