model

package
v0.9.5-rc.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemberIdentityProviderEIP = "eip"
	MemberIdentityProviderENI = "eni"
)

Variables

This section is empty.

Functions

func ValidateVolumeMounts

func ValidateVolumeMounts(volumes []VolumeMount) error

Types

type AutoScalingGroup

type AutoScalingGroup struct {
	MinSize                            *int `yaml:"minSize,omitempty"`
	MaxSize                            int  `yaml:"maxSize,omitempty"`
	RollingUpdateMinInstancesInService *int `yaml:"rollingUpdateMinInstancesInService,omitempty"`
	UnknownKeys                        `yaml:",inline"`
}

Configuration specific to auto scaling groups

func (AutoScalingGroup) Valid

func (asg AutoScalingGroup) Valid() error

type ClusterAutoscaler

type ClusterAutoscaler struct {
	MinSize     int `yaml:"minSize"`
	MaxSize     int `yaml:"maxSize"`
	UnknownKeys `yaml:",inline"`
}

func (ClusterAutoscaler) Enabled

func (a ClusterAutoscaler) Enabled() bool

type Controller

type Controller struct {
	AutoScalingGroup   AutoScalingGroup  `yaml:"autoScalingGroup,omitempty"`
	ClusterAutoscaler  ClusterAutoscaler `yaml:"clusterAutoscaler,omitempty"`
	LoadBalancer       ControllerElb     `yaml:"loadBalancer,omitempty"`
	ManagedIamRoleName string            `yaml:"managedIamRoleName,omitempty"`
	Subnets            []Subnet          `yaml:"subnets,omitempty"`
	UnknownKeys        `yaml:",inline"`
}

TODO Merge this with NodePoolConfig

func NewDefaultController

func NewDefaultController() Controller

func (Controller) LogicalName

func (c Controller) LogicalName() string

func (Controller) Validate

func (c Controller) Validate() error

type ControllerElb

type ControllerElb struct {
	Private bool
	Subnets []Subnet
}

type Etcd

type Etcd struct {
	Subnets     []Subnet    `yaml:"subnets,omitempty"`
	Nodes       []EtcdNode  `yaml:"nodes,omitempty"`
	Cluster     EtcdCluster `yaml:",inline"`
	UnknownKeys `yaml:",inline"`
}

func (Etcd) AdvertisedFQDNTagKey

func (e Etcd) AdvertisedFQDNTagKey() string

AdvertisedFQDNTagKey returns the key of the tag used to identify the advertised hostname of the etcd member of an EBS volume

func (Etcd) EIPAllocationIDTagKey

func (e Etcd) EIPAllocationIDTagKey() string

EIPAllocationIDTagKey returns the key of the tag used to identify the EIP for the etcd member of an EBS volume

func (Etcd) HostedZoneLogicalName

func (e Etcd) HostedZoneLogicalName() (string, error)

func (Etcd) HostedZoneManaged

func (e Etcd) HostedZoneManaged() bool

func (Etcd) HostedZoneRef

func (e Etcd) HostedZoneRef() (string, error)

func (Etcd) InternalDomainName

func (e Etcd) InternalDomainName() (string, error)

func (Etcd) KMSKeyARN

func (e Etcd) KMSKeyARN() string

func (Etcd) LogicalName

func (i Etcd) LogicalName() string

func (Etcd) NameTagKey

func (e Etcd) NameTagKey() string

NameTagKey returns the key of the tag used to identify the name of the etcd member of an EBS volume

func (Etcd) NetworkInterfaceDeviceIndex

func (e Etcd) NetworkInterfaceDeviceIndex() int

NetworkInterfaceDeviceIndex represents that the network interface at index 1 is reserved by kube-aws for etcd peer communication Please submit a feature request if this is inconvenient for you

func (Etcd) NetworkInterfaceIDTagKey

func (e Etcd) NetworkInterfaceIDTagKey() string

NetworkInterfaceIDTagKey returns the key of the tag used to identify the ENI for the etcd member of an EBS volume

func (Etcd) NodeShouldHaveEIP

func (e Etcd) NodeShouldHaveEIP() bool

func (Etcd) NodeShouldHaveSecondaryENI

func (e Etcd) NodeShouldHaveSecondaryENI() bool

type EtcdCluster

type EtcdCluster struct {
	InternalDomainName     string     `yaml:"internalDomainName,omitempty"`
	MemberIdentityProvider string     `yaml:"memberIdentityProvider,omitempty"`
	HostedZone             Identifier `yaml:"hostedZone,omitempty"`
	ManageRecordSets       *bool      `yaml:"manageRecordSets,omitempty"`
	KMSKeyARN              string     `yaml:"kmsKeyArn,omitempty"`
}

func (EtcdCluster) EC2InternalDomainUsed

func (c EtcdCluster) EC2InternalDomainUsed() bool

func (EtcdCluster) GetMemberIdentityProvider

func (c EtcdCluster) GetMemberIdentityProvider() string

func (EtcdCluster) NodeShouldHaveEIP

func (c EtcdCluster) NodeShouldHaveEIP() bool

NodeShouldHaveEIP returns true if all the etcd nodes should have EIPs for their identities

func (EtcdCluster) NodeShouldHaveSecondaryENI

func (c EtcdCluster) NodeShouldHaveSecondaryENI() bool

NodeShouldHaveSecondaryENI returns true if all the etcd nodes should have secondary ENIs for their identities

func (EtcdCluster) RecordSetsManaged

func (e EtcdCluster) RecordSetsManaged() bool

Notes: * EC2's default domain like <region>.compute.internal for internalDomainName implies not to manage record sets * Managed hosted zone implies managed record sets

type EtcdNode

type EtcdNode struct {
	Name string `yaml:"name,omitempty"`
	FQDN string `yaml:"fqdn,omitempty"`
}

type Identifier

type Identifier struct {
	ID                string `yaml:"id,omitempty"`
	IDFromStackOutput string `yaml:"idFromStackOutput,omitempty"`
	IDFromFn          string `yaml:"idFromFn,omitempty"`
}

func (Identifier) HasIdentifier

func (i Identifier) HasIdentifier() bool

func (Identifier) Ref

func (i Identifier) Ref(logicalNameProvider func() string) string

func (Identifier) RefOrError

func (i Identifier) RefOrError(logicalNameProvider func() (string, error)) (string, error)

RefOrError should be used instead of Ref where possible so that kube-aws can print a more useful error message with the line number for the stack-template.json when there's an error.

func (Identifier) Validate

func (i Identifier) Validate() error

type Image

type Image struct {
	Repo          string `yaml:"repo,omitempty"`
	RktPullDocker bool   `yaml:"rktPullDocker,omitempty"`
	Tag           string `yaml:"tag,omitempty"`
}

func (*Image) MergeIfEmpty

func (i *Image) MergeIfEmpty(other Image)

func (*Image) Options

func (i *Image) Options() string

func (*Image) RepoWithTag

func (i *Image) RepoWithTag() string

func (*Image) RktRepo

func (i *Image) RktRepo() string

func (*Image) RktRepoWithoutTag

func (i *Image) RktRepoWithoutTag() string

type InternetGateway

type InternetGateway struct {
	Identifier `yaml:",inline"`
}

func (InternetGateway) ManageInternetGateway

func (g InternetGateway) ManageInternetGateway() bool

type LaunchSpecification

type LaunchSpecification struct {
	WeightedCapacity int    `yaml:"weightedCapacity,omitempty"`
	InstanceType     string `yaml:"instanceType,omitempty"`
	SpotPrice        string `yaml:"spotPrice,omitempty"`
	RootVolume       `yaml:",inline"`
}

func NewLaunchSpecification

func NewLaunchSpecification(weightedCapacity int, instanceType string) LaunchSpecification

func (LaunchSpecification) Valid

func (c LaunchSpecification) Valid() error

type NATGateway

type NATGateway interface {
	EIPAllocationIDRef() (string, error)
	EIPLogicalName() (string, error)
	IsConnectedToPrivateSubnet(Subnet) bool
	LogicalName() string
	ManageEIP() bool
	ManageNATGateway() bool
	ManageRoute() bool
	Ref() string
	PublicSubnetRef() (string, error)
	PrivateSubnets() []Subnet
	Validate() error
}

kube-aws manages at most one NAT gateway per subnet

func NewManagedNATGateway

func NewManagedNATGateway(c NATGatewayConfig, private Subnet, public Subnet) NATGateway

func NewUnmanagedNATGateway

func NewUnmanagedNATGateway(c NATGatewayConfig, private Subnet) NATGateway

type NATGatewayConfig

type NATGatewayConfig struct {
	Identifier      `yaml:",inline"`
	EIPAllocationID string `yaml:"eipAllocationId,omitempty"`
}

func (NATGatewayConfig) Validate

func (c NATGatewayConfig) Validate() error

type NodePoolConfig

type NodePoolConfig struct {
	AutoScalingGroup   AutoScalingGroup  `yaml:"autoScalingGroup,omitempty"`
	ClusterAutoscaler  ClusterAutoscaler `yaml:"clusterAutoscaler"`
	SpotFleet          SpotFleet         `yaml:"spotFleet,omitempty"`
	Count              *int              `yaml:"count,omitempty"`
	CreateTimeout      string            `yaml:"createTimeout,omitempty"`
	InstanceType       string            `yaml:"instanceType,omitempty"`
	ManagedIamRoleName string            `yaml:"managedIamRoleName,omitempty"`
	RootVolume         `yaml:",inline"`
	SpotPrice          string                 `yaml:"spotPrice,omitempty"`
	SecurityGroupIds   []string               `yaml:"securityGroupIds,omitempty"`
	Tenancy            string                 `yaml:"tenancy,omitempty"`
	CustomSettings     map[string]interface{} `yaml:"customSettings,omitempty"`
	VolumeMounts       []VolumeMount          `yaml:"volumeMounts,omitempty"`
	UnknownKeys        `yaml:",inline"`
}

func NewDefaultNodePoolConfig

func NewDefaultNodePoolConfig() NodePoolConfig

func (NodePoolConfig) LogicalName

func (c NodePoolConfig) LogicalName() string

func (NodePoolConfig) MaxCount

func (c NodePoolConfig) MaxCount() int

func (NodePoolConfig) MinCount

func (c NodePoolConfig) MinCount() int

func (NodePoolConfig) RollingUpdateMinInstancesInService

func (c NodePoolConfig) RollingUpdateMinInstancesInService() int

func (NodePoolConfig) Valid

func (c NodePoolConfig) Valid() error

type Region

type Region struct {
	Name string `yaml:"region,omitempty"`
}

func RegionForName

func RegionForName(name string) Region

func (Region) IsChina

func (r Region) IsChina() bool

func (Region) IsEmpty

func (r Region) IsEmpty() bool

func (Region) Partition

func (r Region) Partition() string

func (Region) PrivateDomainName

func (r Region) PrivateDomainName() string

func (Region) PublicComputeDomainName

func (r Region) PublicComputeDomainName() string

func (Region) PublicDomainName

func (r Region) PublicDomainName() string

func (Region) S3Endpoint

func (r Region) S3Endpoint() string

func (Region) String

func (r Region) String() string

func (Region) SupportsKMS

func (r Region) SupportsKMS() bool

type RootVolume

type RootVolume struct {
	RootVolumeType string `yaml:"rootVolumeType,omitempty"`
	RootVolumeIOPS int    `yaml:"rootVolumeIOPS,omitempty"`
	RootVolumeSize int    `yaml:"rootVolumeSize,omitempty"`
}

func NewGp2RootVolume

func NewGp2RootVolume(size int) RootVolume

func NewIo1RootVolume

func NewIo1RootVolume(size int, iops int) RootVolume

func (RootVolume) Validate

func (v RootVolume) Validate() error

type RouteTable

type RouteTable struct {
	Identifier `yaml:",inline"`
}

kube-aws manages at most one route table per subnet If ID or IDFromStackOutput is non-zero, kube-aws doesn't manage the route table but its users' responsibility to provide properly configured one to be reused by kube-aws. More concretely: * If an user is going to reuse an existing route table for a private subnet, it must have a route to a NAT gateway

  • A NAT gateway can be either a classical one with a NAT EC2 instance or an AWS-managed one

* IF an user is going to reuse an existing route table for a public subnet, it must have a route to an Internet gateway

type SpotFleet

type SpotFleet struct {
	TargetCapacity       int                   `yaml:"targetCapacity,omitempty"`
	SpotPrice            string                `yaml:"spotPrice,omitempty"`
	IAMFleetRoleARN      string                `yaml:"iamFleetRoleArn,omitempty"`
	RootVolumeType       string                `yaml:"rootVolumeType"`
	UnitRootVolumeSize   int                   `yaml:"unitRootVolumeSize"`
	UnitRootVolumeIOPS   int                   `yaml:"unitRootVolumeIOPS"`
	LaunchSpecifications []LaunchSpecification `yaml:"launchSpecifications,omitempty"`
	UnknownKeys          `yaml:",inline"`
}

UnitRootVolumeSize/IOPS are used for spot fleets instead of WorkerRootVolumeSize/IOPS, so that we can make them clearer that they are not default size/iops for each worker node but "size/iops per unit" as their names suggest

func (SpotFleet) Enabled

func (f SpotFleet) Enabled() bool

func (SpotFleet) IAMFleetRoleRef

func (f SpotFleet) IAMFleetRoleRef() string

func (SpotFleet) Valid

func (c SpotFleet) Valid() error

func (SpotFleet) WithDefaults

func (f SpotFleet) WithDefaults() SpotFleet

type Subnet

type Subnet struct {
	Identifier       `yaml:",inline"`
	AvailabilityZone string           `yaml:"availabilityZone,omitempty"`
	Name             string           `yaml:"name,omitempty"`
	InstanceCIDR     string           `yaml:"instanceCIDR,omitempty"`
	InternetGateway  InternetGateway  `yaml:"internetGateway,omitempty"`
	NATGateway       NATGatewayConfig `yaml:"natGateway,omitempty"`
	Private          bool             `yaml:"private,omitempty"`
	RouteTable       RouteTable       `yaml:"routeTable,omitempty"`
}

func NewExistingPrivateSubnet

func NewExistingPrivateSubnet(az string, id string) Subnet

func NewExistingPublicSubnet

func NewExistingPublicSubnet(az string, id string) Subnet

func NewImportedPrivateSubnet

func NewImportedPrivateSubnet(az string, name string) Subnet

func NewImportedPublicSubnet

func NewImportedPublicSubnet(az string, name string) Subnet

func NewPrivateSubnet

func NewPrivateSubnet(az string, cidr string) Subnet

func NewPrivateSubnetFromFn

func NewPrivateSubnetFromFn(az string, fn string) Subnet

func NewPrivateSubnetWithPreconfiguredNATGateway

func NewPrivateSubnetWithPreconfiguredNATGateway(az string, cidr string, ngw string) Subnet

func NewPrivateSubnetWithPreconfiguredNATGatewayEIP

func NewPrivateSubnetWithPreconfiguredNATGatewayEIP(az string, cidr string, alloc string) Subnet

func NewPrivateSubnetWithPreconfiguredRouteTable

func NewPrivateSubnetWithPreconfiguredRouteTable(az string, cidr string, rtb string) Subnet

func NewPublicSubnet

func NewPublicSubnet(az string, cidr string) Subnet

func NewPublicSubnetFromFn

func NewPublicSubnetFromFn(az string, fn string) Subnet

func NewPublicSubnetWithPreconfiguredRouteTable

func NewPublicSubnetWithPreconfiguredRouteTable(az string, cidr string, rtb string) Subnet

func (*Subnet) InternetGatewayRouteLogicalName

func (s *Subnet) InternetGatewayRouteLogicalName() string

func (*Subnet) LogicalName

func (s *Subnet) LogicalName() string

func (*Subnet) ManageNATGateway

func (s *Subnet) ManageNATGateway() bool

ManageNATGateway returns true if a NAT gateway for this subnet must be created or updated by kube-aws kube-aws creates or updates a NAT gateway if: * the subnet is private and * the subnet is going to be managed by kube-aws(an existing subnet is NOT specified) and * the route table for the subnet is going to be managed by kube-aws(an existing subnet is NOT specified) and * an existing NAT gateway ID is not specified to be reused

func (*Subnet) ManageRouteTable

func (s *Subnet) ManageRouteTable() bool

ManageRouteTable returns true if a route table for this subnet must be created or updated by kube-aws kube-aws creates a route table if and only if the subnet is also going to be managed and an existing route table for it isn't specified

func (*Subnet) ManageRouteToInternet

func (s *Subnet) ManageRouteToInternet() bool

ManageRouteToInternet returns true if a route from this subnet to an IGW must be created or updated by kube-aws kube-aws creates a route to an IGW for an subnet if and only if: * the subnet is public and * the subnet is going to be managed by kube-aws and * the route table is going to be managed by kube-aws In other words, kube-aws won't create or update a route to an IGW if: * the subnet is private or * an existing subnet is used or * an existing route table is used

func (*Subnet) ManageRouteToNATGateway

func (s *Subnet) ManageRouteToNATGateway() bool

ManageRouteToNATGateway returns true if a route to a NAT gateway for this subnet must be created or updated by kube-aws kube-aws creates or updates a NAT gateway if: * the NGW is going to be managed or * an existing NAT gateway ID is specified

func (*Subnet) ManageSubnet

func (s *Subnet) ManageSubnet() bool

ManageSubnet returns true if this subnet must be managed(created or updated) by kube-aws kube-aws creates a subnet if subnet.id and subnet.idFromStackOutput are not specified

func (*Subnet) MapPublicIPs

func (s *Subnet) MapPublicIPs() bool

func (*Subnet) NATGatewayRouteLogicalName

func (s *Subnet) NATGatewayRouteLogicalName() string

func (*Subnet) Public

func (s *Subnet) Public() bool

func (*Subnet) Ref

func (s *Subnet) Ref() string

Ref returns ID or ref to newly created resource

func (*Subnet) RouteTableID

func (s *Subnet) RouteTableID() string

func (*Subnet) RouteTableLogicalName

func (s *Subnet) RouteTableLogicalName() (string, error)

RouteTableLogicalName represents the name of the route table to which this subnet is associated.

func (*Subnet) RouteTableRef

func (s *Subnet) RouteTableRef() (string, error)

func (*Subnet) Validate

func (s *Subnet) Validate() error

type UnknownKeys

type UnknownKeys map[string]interface{}

func (UnknownKeys) FailWhenUnknownKeysFound

func (unknownKeys UnknownKeys) FailWhenUnknownKeysFound(keyPath string) error

type VolumeMount

type VolumeMount struct {
	Type   string `yaml:"type,omitempty"`
	Iops   int    `yaml:"iops,omitempty"`
	Size   int    `yaml:"size,omitempty"`
	Device string `yaml:"device,omitempty"`
	Path   string `yaml:"path,omitempty"`
}

func (VolumeMount) SystemdMountName

func (v VolumeMount) SystemdMountName() string

func (VolumeMount) Validate

func (v VolumeMount) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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