Version: v1.4.3 Latest Latest

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

Go to latest
Published: Dec 14, 2016 License: Apache-2.0 Imports: 33 Imported by: 0




View Source
const (
	KEY_NAME = "name"
	KEY_TYPE = "_type"
View Source
const DefaultMasterMachineTypeAWS = "m3.medium"
View Source
const DefaultMasterMachineTypeGCE = "n1-standard-1"
View Source
const DefaultNodeMachineTypeAWS = "t2.medium"
View Source
const DefaultNodeMachineTypeGCE = "n1-standard-2"
View Source
const IAMPolicyDefaultVersion = "2012-10-17"
View Source
const MaxAttemptsWithNoProgress = 3
View Source
const (
	NodeUpVersion = "1.4.3"
View Source
const TargetDirect = "direct"
View Source
const TargetDryRun = "dryrun"
View Source
const TargetTerraform = "terraform"


View Source
var CloudupModels = []string{"config", "proto", "cloudup"}
View Source
var EtcdClusters = []string{"main", "events"}


func BuildCloud

func BuildCloud(cluster *api.Cluster) (fi.Cloud, error)

func ChannelForCluster

func ChannelForCluster(c *api.Cluster) (*api.Channel, error)

func PopulateClusterSpec

func PopulateClusterSpec(cluster *api.Cluster) (*api.Cluster, error)

PopulateClusterSpec takes a user-specified cluster spec, and computes the full specification that should be set on the cluster. We do this so that we don't need any real "brains" on the node side.

func PopulateInstanceGroupSpec

func PopulateInstanceGroupSpec(cluster *api.Cluster, input *api.InstanceGroup, channel *api.Channel) (*api.InstanceGroup, error)

PopulateInstanceGroupSpec sets default values in the InstanceGroup The InstanceGroup is simpler than the cluster spec, so we just populate in place (like the rest of k8s)


type ApplyClusterCmd

type ApplyClusterCmd struct {
	Cluster *api.Cluster

	InstanceGroups []*api.InstanceGroup

	// NodeUpSource is the location from which we download nodeup
	NodeUpSource string

	// Models is a list of cloudup models to apply
	Models []string

	// TargetName specifies how we are operating e.g. direct to GCE, or AWS, or dry-run, or terraform
	TargetName string

	// Target is the fi.Target we will operate against
	Target fi.Target

	// OutDir is a local directory in which we place output, can cache files etc
	OutDir string

	// Assets is a list of sources for files (primarily when not using everything containerized)
	// Formats:
	//  raw url: http://... or https://...
	//  url with hash: <hex>@http://... or <hex>@https://...
	Assets []string

	Clientset simple.Clientset

	// DryRun is true if this is only a dry run
	DryRun bool

func (*ApplyClusterCmd) Run

func (c *ApplyClusterCmd) Run() error

type IAMPolicy

type IAMPolicy struct {
	Version   string
	Statement []*IAMStatement

func (*IAMPolicy) AsJSON

func (p *IAMPolicy) AsJSON() (string, error)

type IAMPolicyBuilder

type IAMPolicyBuilder struct {
	Cluster *api.Cluster
	Role    api.InstanceGroupRole
	Region  string

func (*IAMPolicyBuilder) BuildAWSIAMPolicy

func (b *IAMPolicyBuilder) BuildAWSIAMPolicy() (*IAMPolicy, error)

func (*IAMPolicyBuilder) IAMPrefix

func (b *IAMPolicyBuilder) IAMPrefix() string

IAMPrefix returns the prefix for AWS ARNs in the current region, for use with IAM it is arn:aws everywhere but in cn-north, where it is arn:aws-cn

type IAMStatement

type IAMStatement struct {
	Effect   IAMStatementEffect
	Action   []string
	Resource []string

type IAMStatementEffect

type IAMStatementEffect string
const IAMStatementEffectAllow IAMStatementEffect = "Allow"

type Loader

type Loader struct {
	Cluster *api.Cluster

	WorkDir string

	ModelStore vfs.Path

	Tags              map[string]struct{}
	TemplateFunctions template.FuncMap

	Resources map[string]fi.Resource
	// contains filtered or unexported fields

func (*Loader) AddTypes

func (l *Loader) AddTypes(types map[string]interface{})

func (*Loader) BuildTasks

func (l *Loader) BuildTasks(modelStore vfs.Path, models []string) (map[string]fi.Task, error)

func (*Loader) Init

func (l *Loader) Init()

type SpecBuilder

type SpecBuilder struct {
	OptionsLoader *loader.OptionsLoader

	Tags map[string]struct{}

func (*SpecBuilder) BuildCompleteSpec

func (l *SpecBuilder) BuildCompleteSpec(clusterSpec *api.ClusterSpec, modelStore vfs.Path, models []string) (*api.ClusterSpec, error)

type TemplateFunctions

type TemplateFunctions struct {
	// contains filtered or unexported fields

func (*TemplateFunctions) APIServerCount

func (tf *TemplateFunctions) APIServerCount() int

APIServerCount returns the value for the apiserver --apiserver-count flag

func (*TemplateFunctions) AddTo

func (tf *TemplateFunctions) AddTo(dest template.FuncMap)

func (*TemplateFunctions) AdminCIDR

func (tf *TemplateFunctions) AdminCIDR() (string, error)

AdminCIDR returns the single CIDR that is allowed access to the admin ports of the cluster (22, 443 on master)

func (*TemplateFunctions) CloudTags

func (tf *TemplateFunctions) CloudTags(ig *api.InstanceGroup) (map[string]string, error)

CloudTags computes the tags to apply to instances in the specified InstanceGroup

func (*TemplateFunctions) DnsControllerArgv added in v1.4.1

func (tf *TemplateFunctions) DnsControllerArgv() ([]string, error)

func (*TemplateFunctions) EtcdClusterMemberTags

func (tf *TemplateFunctions) EtcdClusterMemberTags(etcd *api.EtcdClusterSpec, m *api.EtcdMemberSpec) map[string]string

func (*TemplateFunctions) GetInstanceGroup

func (tf *TemplateFunctions) GetInstanceGroup(name string) (*api.InstanceGroup, error)

GetInstanceGroup returns the instance group with the specified name

func (*TemplateFunctions) HasTag

func (tf *TemplateFunctions) HasTag(tag string) bool

HasTag returns true if the specified tag is set

func (*TemplateFunctions) IAMServiceEC2

func (tf *TemplateFunctions) IAMServiceEC2() string

IAMServiceEC2 returns the name of the IAM service for EC2 in the current region it is everywhere but in cn-north, where it is

func (*TemplateFunctions) Image

func (tf *TemplateFunctions) Image(component string) (string, error)

Image returns the docker image name for the specified component

func (*TemplateFunctions) SharedVPC

func (tf *TemplateFunctions) SharedVPC() bool

SharedVPC is a simple helper function which makes the templates for a shared VPC clearer

func (*TemplateFunctions) SharedZone

func (tf *TemplateFunctions) SharedZone(zone *api.ClusterZoneSpec) bool

SharedZone is a simple helper function which makes the templates for a shared Zone clearer

func (*TemplateFunctions) WellKnownServiceIP

func (tf *TemplateFunctions) WellKnownServiceIP(id int) (net.IP, error)


Path Synopsis

Jump to

Keyboard shortcuts

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