cloudup

package
v0.0.0-...-7a4df5e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: Apache-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This IP is from TEST-NET-3
	// https://en.wikipedia.org/wiki/Reserved_IP_addresses
	PlaceholderIP  = "203.0.113.123"
	PlaceholderTTL = 10
)
View Source
const (
	KEY_NAME = "name"
	KEY_TYPE = "_type"
)
View Source
const (
	DefaultMaxTaskDuration = 10 * time.Minute
)
View Source
const (

	// Environment variable for overriding CNI url
	ENV_VAR_CNI_VERSION_URL = "CNI_VERSION_URL"
)
View Source
const TargetCloudformation = "cloudformation"
View Source
const TargetDirect = "direct"
View Source
const TargetDryRun = "dryrun"
View Source
const TargetTerraform = "terraform"

Variables

View Source
var (
	// AlphaAllowBareMetal is a feature flag that gates BareMetal support while it is alpha
	AlphaAllowBareMetal = featureflag.New("AlphaAllowBareMetal", featureflag.Bool(false))
	// AlphaAllowDO is a feature flag that gates DigitalOcean support while it is alpha
	AlphaAllowDO = featureflag.New("AlphaAllowDO", featureflag.Bool(false))
	// AlphaAllowGCE is a feature flag that gates GCE support while it is alpha
	AlphaAllowGCE = featureflag.New("AlphaAllowGCE", featureflag.Bool(false))
	// AlphaAllowVsphere is a feature flag that gates vsphere support while it is alpha
	AlphaAllowVsphere = featureflag.New("AlphaAllowVsphere", featureflag.Bool(false))
	// CloudupModels a list of supported models
	CloudupModels = []string{"config", "proto", "cloudup"}
)
View Source
var EtcdClusters = []string{"main", "events"}

Phases are used for validation and cli help.

Functions

func BaseUrl

func BaseUrl() string

BaseUrl returns the base url for the distribution of kops - in particular for nodeup & docker images

func BuildCloud

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

func ChannelForCluster

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

func FindDNSHostedZone

func FindDNSHostedZone(dns dnsprovider.Interface, clusterDNSName string, dnsType kops.DNSType) (string, error)

func FindLatestKubernetesVersion

func FindLatestKubernetesVersion() (string, error)

FindLatestKubernetesVersion returns the latest kubernetes version, as stored at https://storage.googleapis.com/kubernetes-release/release/stable.txt This shouldn't be used any more; we prefer reading the stable channel

func NodeUpLocation

func NodeUpLocation() string

NodeUpLocation returns the URL where nodeup should be downloaded

func PerformAssignments

func PerformAssignments(c *kops.Cluster) error

PerformAssignments populates values that are required and immutable For example, it assigns stable Keys to InstanceGroups & Masters, and it assigns CIDRs to subnets We also assign KubernetesVersion, because we want it to be explicit

PerformAssignments is called on create, as well as an update. In fact any time Run() is called in apply_cluster.go we will reach this function. Please do all after-market logic here.

func PopulateClusterSpec

func PopulateClusterSpec(clientset simple.Clientset, cluster *api.Cluster, assetBuilder *assets.AssetBuilder) (*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 *kops.Cluster, input *kops.InstanceGroup, channel *kops.Channel) (*kops.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)

func ProtokubeImageSource

func ProtokubeImageSource() string

ProtokubeImageSource returns the source for the docker image for protokube. Either a docker name (e.g. gcr.io/protokube:1.4), or a URL (https://...) in which case we download the contents of the url and docker load it

Types

type ApplyClusterCmd

type ApplyClusterCmd struct {
	Cluster *kops.Cluster

	InstanceGroups []*kops.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

	MaxTaskDuration time.Duration

	// Phase can be set to a Phase to run the specific subset of tasks, if we don't want to run everything
	Phase Phase
	// contains filtered or unexported fields
}

func (*ApplyClusterCmd) Run

func (c *ApplyClusterCmd) Run() error

type BootstrapChannelBuilder

type BootstrapChannelBuilder struct {
	Lifecycle *fi.Lifecycle
	// contains filtered or unexported fields
}

func (*BootstrapChannelBuilder) Build

type ByZone

type ByZone []*kops.ClusterSubnetSpec

ByZone implements sort.Interface for []*ClusterSubnetSpec based on the Zone field.

func (ByZone) Len

func (a ByZone) Len() int

func (ByZone) Less

func (a ByZone) Less(i, j int) bool

func (ByZone) Swap

func (a ByZone) Swap(i, j int)

type Loader

type Loader struct {
	Cluster *api.Cluster

	WorkDir string

	ModelStore vfs.Path

	Tags              sets.String
	TemplateFunctions template.FuncMap

	Resources map[string]fi.Resource

	Builders []fi.ModelBuilder
	// 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, assetBuilder *assets.AssetBuilder, lifecycle *fi.Lifecycle) (map[string]fi.Task, error)

func (*Loader) Init

func (l *Loader) Init()

type Phase

type Phase string

Phase is a portion of work that kops completes.

const (
	// PhaseStageAssets uploads various assets such as containers in a private registry
	PhaseStageAssets Phase = "assets"
	// PhaseNetwork creates network infrastructure.
	PhaseNetwork Phase = "network"
	// PhaseIAM creates IAM profiles and roles, security groups and firewalls
	PhaseSecurity Phase = "security"
	// PhaseCluster creates the servers, and load-alancers
	PhaseCluster Phase = "cluster"
)

type SpecBuilder

type SpecBuilder struct {
	OptionsLoader *loader.OptionsLoader

	Tags sets.String
}

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)

This will define the available functions we can use in our YAML models If we are trying to get a new function implemented it MUST be defined here.

func (*TemplateFunctions) DnsControllerArgv

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

DnsControllerArgv returns the args to the DNS controller

func (*TemplateFunctions) ExternalDnsArgv

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

func (*TemplateFunctions) GetInstanceGroup

func (tf *TemplateFunctions) GetInstanceGroup(name string) (*kops.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) ProxyEnv

func (tf *TemplateFunctions) ProxyEnv() map[string]string

func (*TemplateFunctions) SharedVPC

func (tf *TemplateFunctions) SharedVPC() bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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