Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCloud(cluster *api.Cluster) (fi.Cloud, error)
- func ChannelForCluster(c *api.Cluster) (*api.Channel, error)
- func PopulateClusterSpec(cluster *api.Cluster) (*api.Cluster, error)
- func PopulateInstanceGroupSpec(cluster *api.Cluster, input *api.InstanceGroup, channel *api.Channel) (*api.InstanceGroup, error)
- type ApplyClusterCmd
- type IAMPolicy
- type IAMPolicyBuilder
- type IAMStatement
- type IAMStatementEffect
- type Loader
- type SpecBuilder
- type TemplateFunctions
- func (tf *TemplateFunctions) APIServerCount() int
- func (tf *TemplateFunctions) AddTo(dest template.FuncMap)
- func (tf *TemplateFunctions) AdminCIDR() (string, error)
- func (tf *TemplateFunctions) CloudTags(ig *api.InstanceGroup) (map[string]string, error)
- func (tf *TemplateFunctions) DnsControllerArgv() ([]string, error)
- func (tf *TemplateFunctions) EtcdClusterMemberTags(etcd *api.EtcdClusterSpec, m *api.EtcdMemberSpec) map[string]string
- func (tf *TemplateFunctions) GetInstanceGroup(name string) (*api.InstanceGroup, error)
- func (tf *TemplateFunctions) HasTag(tag string) bool
- func (tf *TemplateFunctions) IAMServiceEC2() string
- func (tf *TemplateFunctions) Image(component string) (string, error)
- func (tf *TemplateFunctions) SharedVPC() bool
- func (tf *TemplateFunctions) SharedZone(zone *api.ClusterZoneSpec) bool
- func (tf *TemplateFunctions) WellKnownServiceIP(id int) (net.IP, error)
Constants ¶
const ( KEY_NAME = "name" KEY_TYPE = "_type" )
const DefaultMasterMachineTypeAWS = "m3.medium"
const DefaultMasterMachineTypeGCE = "n1-standard-1"
const DefaultNodeMachineTypeAWS = "t2.medium"
const DefaultNodeMachineTypeGCE = "n1-standard-2"
const IAMPolicyDefaultVersion = "2012-10-17"
const MaxAttemptsWithNoProgress = 3
const (
NodeUpVersion = "1.4.3"
)
const TargetDirect = "direct"
const TargetDryRun = "dryrun"
const TargetTerraform = "terraform"
Variables ¶
var CloudupModels = []string{"config", "proto", "cloudup"}
var EtcdClusters = []string{"main", "events"}
Functions ¶
func PopulateClusterSpec ¶
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)
Types ¶
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 }
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) BuildTasks ¶
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 ec2.amazonaws.com everywhere but in cn-north, where it is ec2.amazonaws.com.cn
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)