Documentation ¶
Index ¶
- Constants
- Variables
- func BaseUrl() string
- func BuildCloud(cluster *kops.Cluster) (fi.Cloud, error)
- func ChannelForCluster(c *kops.Cluster) (*kops.Channel, error)
- func FindDNSHostedZone(dns dnsprovider.Interface, clusterDNSName string, dnsType kops.DNSType) (string, error)
- func FindLatestKubernetesVersion() (string, error)
- func NodeUpLocation() string
- func PerformAssignments(c *kops.Cluster) error
- func PopulateClusterSpec(clientset simple.Clientset, cluster *api.Cluster, ...) (*api.Cluster, error)
- func PopulateInstanceGroupSpec(cluster *kops.Cluster, input *kops.InstanceGroup, channel *kops.Channel) (*kops.InstanceGroup, error)
- func ProtokubeImageSource() string
- type ApplyClusterCmd
- type BootstrapChannelBuilder
- type ByZone
- type Loader
- type Phase
- type SpecBuilder
- type TemplateFunctions
- func (tf *TemplateFunctions) AddTo(dest template.FuncMap)
- func (tf *TemplateFunctions) DnsControllerArgv() ([]string, error)
- func (tf *TemplateFunctions) ExternalDnsArgv() ([]string, error)
- func (tf *TemplateFunctions) GetInstanceGroup(name string) (*kops.InstanceGroup, error)
- func (tf *TemplateFunctions) HasTag(tag string) bool
- func (tf *TemplateFunctions) ProxyEnv() map[string]string
- func (tf *TemplateFunctions) SharedVPC() bool
Constants ¶
const ( // This IP is from TEST-NET-3 // https://en.wikipedia.org/wiki/Reserved_IP_addresses PlaceholderIP = "203.0.113.123" PlaceholderTTL = 10 )
const ( KEY_NAME = "name" KEY_TYPE = "_type" )
const (
DefaultMaxTaskDuration = 10 * time.Minute
)
const (
// Environment variable for overriding CNI url
ENV_VAR_CNI_VERSION_URL = "CNI_VERSION_URL"
)
const TargetCloudformation = "cloudformation"
const TargetDirect = "direct"
const TargetDryRun = "dryrun"
const TargetTerraform = "terraform"
Variables ¶
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"} )
var EtcdClusters = []string{"main", "events"}
var Phases = sets.NewString( string(PhaseStageAssets), string(PhaseSecurity), string(PhaseNetwork), string(PhaseCluster), )
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 FindDNSHostedZone ¶
func FindLatestKubernetesVersion ¶
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 ¶
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 ¶
func (b *BootstrapChannelBuilder) Build(c *fi.ModelBuilderContext) error
type ByZone ¶
type ByZone []*kops.ClusterSubnetSpec
ByZone implements sort.Interface for []*ClusterSubnetSpec based on the Zone field.
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) BuildTasks ¶
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