Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCloud(cluster *api.Cluster) (fi.Cloud, error)
- func PopulateClusterSpec(cluster *api.Cluster, clusterRegistry *api.ClusterRegistry) (*api.Cluster, error)
- func PopulateInstanceGroupSpec(cluster *api.Cluster, input *api.InstanceGroup) (*api.InstanceGroup, error)
- type ApplyClusterCmd
- type Loader
- type SpecBuilder
- type TemplateFunctions
- func (tf *TemplateFunctions) AddTo(dest template.FuncMap)
- func (tf *TemplateFunctions) AdminCIDR() (string, error)
- func (tf *TemplateFunctions) EtcdClusterMemberTags(etcd *api.EtcdClusterSpec, m *api.EtcdMemberSpec) map[string]string
- func (tf *TemplateFunctions) IAMPrefix() string
- func (tf *TemplateFunctions) IAMServiceEC2() string
- func (tf *TemplateFunctions) Image(component string) (string, error)
- func (tf *TemplateFunctions) SharedVPC() bool
- func (tf *TemplateFunctions) WellKnownServiceIP(id int) (net.IP, error)
Constants ¶
const ( KEY_NAME = "name" KEY_TYPE = "_type" )
const DefaultMasterMachineTypeAWS = "m3.large"
const DefaultMasterMachineTypeGCE = "n1-standard-2"
const DefaultNodeMachineTypeAWS = "t2.medium"
const DefaultNodeMachineTypeGCE = "n1-standard-2"
const MaxAttemptsWithNoProgress = 3
const TargetDirect = "direct"
const TargetDryRun = "dryrun"
const TargetTerraform = "terraform"
Variables ¶
var EtcdClusters = []string{"main", "events"}
Functions ¶
func PopulateClusterSpec ¶
func PopulateClusterSpec(cluster *api.Cluster, clusterRegistry *api.ClusterRegistry) (*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) (*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 // ClusterRegistry manages the cluster configuration storage ClusterRegistry *api.ClusterRegistry // DryRun is true if this is only a dry run DryRun bool }
func (*ApplyClusterCmd) Run ¶
func (c *ApplyClusterCmd) Run() error
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) 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) EtcdClusterMemberTags ¶
func (tf *TemplateFunctions) EtcdClusterMemberTags(etcd *api.EtcdClusterSpec, m *api.EtcdMemberSpec) map[string]string
func (*TemplateFunctions) IAMPrefix ¶
func (tf *TemplateFunctions) 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
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) WellKnownServiceIP ¶
func (tf *TemplateFunctions) WellKnownServiceIP(id int) (net.IP, error)