model

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemberIdentityProviderEIP = "eip"
	MemberIdentityProviderENI = "eni"
)
View Source
const (
	USERDATA_S3       = "s3"
	USERDATA_INSTANCE = "instance"
)
View Source
const DefaultAPIEndpointName = "Default"

DefaultAPIEndpointName is the default endpoint name used when you've omitted `apiEndpoints` but not `externalDNSName`

View Source
const DefaultControllerCount = 1
View Source
const DefaultRecordSetTTL = 300

DefaultRecordSetTTL is the default value for the loadBalancer.recordSetTTL key

Variables

View Source
var GPUEnabledInstanceFamily = []string{"p2", "g2"}

Functions

func ValidateVolumeMounts

func ValidateVolumeMounts(volumes []VolumeMount) error

Types

type APIEndpoint added in v0.9.6

type APIEndpoint struct {
	// Name is the unique name of this API endpoint used by kube-aws for identifying this API endpoint
	Name string `yaml:"name,omitempty"`
	// DNSName is the FQDN of this endpoint
	// A record set may or may not be created with this DNS name.
	// TLS certificates generated by kube-aws would contain this name in the list of common names.
	DNSName string `yaml:"dnsName,omitempty"`
	// LoadBalancer is a set of an ELB and relevant settings and resources to serve a Kubernetes API hosted by controller nodes
	LoadBalancer APIEndpointLB `yaml:"loadBalancer,omitempty"`
	//DNSRoundRobin APIDNSRoundRobin `yaml:"dnsRoundRobin,omitempty"`
	UnknownKeys `yaml:",inline"`
}

APIEndpoint is a Kubernetes API endpoint to which various clients connect. Each endpoint can be served by an existing ELB or a kube-aws managed ELB.

func (APIEndpoint) Validate added in v0.9.6

func (e APIEndpoint) Validate() error

Validate returns an error when there's any user error in the `apiEndpoint` settings

type APIEndpointLB added in v0.9.6

type APIEndpointLB struct {
	// APIAccessAllowedSourceCIDRs is network ranges of sources you'd like Kubernetes API accesses to be allowed from, in CIDR notation
	APIAccessAllowedSourceCIDRs CIDRRanges `yaml:"apiAccessAllowedSourceCIDRs,omitempty"`
	// CreateRecordSet is set to false when you want to disable creation of the record set for this api load balancer
	CreateRecordSet *bool `yaml:"createRecordSet,omitempty"`
	// Identifier specifies an existing load-balancer used for load-balancing controller nodes and serving this endpoint
	Identifier Identifier `yaml:",inline"`
	// Subnets contains all the subnets assigned to this load-balancer. Specified only when this load balancer is not reused but managed one
	SubnetReferences []SubnetReference `yaml:"subnets,omitempty"`
	// PrivateSpecified determines the resulting load balancer uses an internal elb for an endpoint
	PrivateSpecified *bool `yaml:"private,omitempty"`
	// RecordSetTTLSpecified is the TTL for the record set to this load balancer. Defaults to 300 if nil
	RecordSetTTLSpecified *int `yaml:"recordSetTTL,omitempty"`
	// HostedZone is where the resulting Alias record is created for an endpoint
	HostedZone HostedZone `yaml:"hostedZone,omitempty"`
	//// SecurityGroups contains extra security groups must be associated to the lb serving API requests from clients
	//SecurityGroups []SecurityGroup
	// SecurityGroupIds represents SGs associated to this LB. Required when APIAccessAllowedSourceCIDRs is explicitly set to empty
	SecurityGroupIds []string `yaml:"securityGroupIds"`
}

APIEndpointLB is a set of an ELB and relevant settings and resources to serve a Kubernetes API hosted by controller nodes

func (APIEndpointLB) ManageELB added in v0.9.6

func (e APIEndpointLB) ManageELB() bool

ManageELB returns true if an ELB should be managed by kube-aws

func (APIEndpointLB) ManageELBRecordSet added in v0.9.6

func (e APIEndpointLB) ManageELBRecordSet() bool

ManageELBRecordSet returns tru if kube-aws should create a record set for the ELB

func (APIEndpointLB) ManageSecurityGroup added in v0.9.6

func (e APIEndpointLB) ManageSecurityGroup() bool

ManageSecurityGroup returns true if kube-aws should create a security group for this ELB

func (APIEndpointLB) Private added in v0.9.6

func (e APIEndpointLB) Private() bool

Private returns true when this LB is a private one i.e. the `private` field is explicitly set to true

func (APIEndpointLB) RecordSetTTL added in v0.9.6

func (e APIEndpointLB) RecordSetTTL() int

RecordSetTTL is the TTL for the record set to this load balancer. Defaults to 300 if `recordSetTTL` is omitted/set to nil

func (*APIEndpointLB) UnmarshalYAML added in v0.9.6

func (e *APIEndpointLB) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals YAML data to an APIEndpointLB object with defaults This doesn't work due to a go-yaml issue described in http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/ And that's why we need to implement `func (e APIEndpointLB) RecordSetTTL() int` for defaulting. TODO Migrate to ghodss/yaml

func (APIEndpointLB) Validate added in v0.9.6

func (e APIEndpointLB) Validate() error

Validate returns an error when there's any user error in the settings of the `loadBalancer` field

type APIEndpoints added in v0.9.6

type APIEndpoints []APIEndpoint

func NewDefaultAPIEndpoints added in v0.9.6

func NewDefaultAPIEndpoints(dnsName string, subnets []SubnetReference, hostedZoneId string, createRecordSet bool, recordSetTTL int, private bool) APIEndpoints

NewDefaultAPIEndpoints creates the slice of API endpoints containing only the default one which is with arbitrary DNS name and an ELB

func (APIEndpoints) Validate added in v0.9.6

func (e APIEndpoints) Validate() error

Validate returns an error if there's any user error in the settings of apiEndpoints

type ARN added in v0.9.8

type ARN struct {
	Arn                string `yaml:"arn,omitempty"`
	ArnFromStackOutput string `yaml:"arnFromStackOutput,omitempty"`
	ArnFromFn          string `yaml:"arnFromFn,omitempty"`
}

func (ARN) HasArn added in v0.9.8

func (i ARN) HasArn() bool

HasArn returns true when the id of a resource i.e. either `arn` or `arnFromStackOutput` is specified

func (ARN) OrExpr added in v0.9.8

func (i ARN) OrExpr(exprProvider func() (string, error)) (string, error)

func (ARN) OrGetAttArn added in v0.9.8

func (i ARN) OrGetAttArn(logicalNameProvider func() (string, error)) (string, error)

func (ARN) OrRef added in v0.9.8

func (i ARN) OrRef(logicalNameProvider func() (string, error)) (string, error)

func (ARN) Validate added in v0.9.8

func (i ARN) Validate() error

type Addons added in v0.9.6

type Addons struct {
	Rescheduler       Rescheduler              `yaml:"rescheduler"`
	ClusterAutoscaler ClusterAutoscalerSupport `yaml:"clusterAutoscaler,omitempty"`
	UnknownKeys       `yaml:",inline"`
}

type Asset added in v0.9.7

type Asset struct {
	AssetLocation
	Content string
}

func (Asset) S3Prefix added in v0.9.7

func (l Asset) S3Prefix() (string, error)

type AssetID added in v0.9.7

type AssetID struct {
	StackName string
	Filename  string
}

func NewAssetID added in v0.9.7

func NewAssetID(stack string, file string) AssetID

type AssetLocation added in v0.9.7

type AssetLocation struct {
	ID     AssetID
	Key    string
	Bucket string
	Path   string
	Region Region
}

func (AssetLocation) S3URL added in v0.9.7

func (l AssetLocation) S3URL() (string, error)

func (AssetLocation) URL added in v0.9.7

func (l AssetLocation) URL() (string, error)

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) Validate added in v0.9.8

func (asg AutoScalingGroup) Validate() error

type Autoscaling added in v0.9.7

type Autoscaling struct {
	ClusterAutoscaler ClusterAutoscaler `yaml:"clusterAutoscaler,omitempty"`
}

type CIDRRange added in v0.9.6

type CIDRRange struct {
	// contains filtered or unexported fields
}

CIDRRange represents an IP network range in CIDR notation See http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-ingress.html#cfn-ec2-security-group-ingress-cidrip

func (CIDRRange) String added in v0.9.6

func (c CIDRRange) String() string

String returns the string representation of this CIDR range

func (*CIDRRange) UnmarshalYAML added in v0.9.6

func (c *CIDRRange) UnmarshalYAML(unmarshal func(interface{}) error) error

type CIDRRanges added in v0.9.6

type CIDRRanges []CIDRRange

CIDRRanges represents IP network ranges in CIDR notation

func DefaultCIDRRanges added in v0.9.6

func DefaultCIDRRanges() CIDRRanges

type ClusterAutoscaler

type ClusterAutoscaler struct {
	Enabled     bool `yaml:"enabled,omitempty"`
	UnknownKeys `yaml:",inline"`
}

func (ClusterAutoscaler) AutoDiscoveryTagKey added in v0.9.7

func (a ClusterAutoscaler) AutoDiscoveryTagKey() string

type ClusterAutoscalerSupport added in v0.9.7

type ClusterAutoscalerSupport struct {
	Enabled     bool `yaml:"enabled"`
	UnknownKeys `yaml:",inline"`
}

type Controller

type Controller struct {
	AutoScalingGroup   AutoScalingGroup `yaml:"autoScalingGroup,omitempty"`
	Autoscaling        Autoscaling      `yaml:"autoscaling,omitempty"`
	EC2Instance        `yaml:",inline"`
	LoadBalancer       ControllerElb       `yaml:"loadBalancer,omitempty"`
	IAMConfig          IAMConfig           `yaml:"iam,omitempty"`
	SecurityGroupIds   []string            `yaml:"securityGroupIds"`
	Subnets            []Subnet            `yaml:"subnets,omitempty"`
	CustomFiles        []CustomFile        `yaml:"customFiles,omitempty"`
	CustomSystemdUnits []CustomSystemdUnit `yaml:"customSystemdUnits,omitempty"`
	NodeSettings       `yaml:",inline"`
	UnknownKeys        `yaml:",inline"`
}

TODO Merge this with NodePoolConfig

func NewDefaultController

func NewDefaultController() Controller

func (Controller) LogicalName

func (c Controller) LogicalName() string

func (Controller) SecurityGroupRefs added in v0.9.6

func (c Controller) SecurityGroupRefs() []string

func (Controller) Validate

func (c Controller) Validate() error

type ControllerElb

type ControllerElb struct {
	Private bool
	Subnets []Subnet
}

type CustomFile added in v0.9.6

type CustomFile struct {
	Path        string `yaml:"path"`
	Permissions uint   `yaml:"permissions"`
	Content     string `yaml:"content"`
	UnknownKeys `yaml:",inline"`
}

func (CustomFile) GzippedBase64Content added in v0.9.6

func (c CustomFile) GzippedBase64Content() string

func (CustomFile) PermissionsString added in v0.9.6

func (c CustomFile) PermissionsString() string

type CustomSystemdUnit added in v0.9.6

type CustomSystemdUnit struct {
	Name        string `yaml:"name"`
	Command     string `yaml:"command"`
	Content     string `yaml:"content"`
	Enable      bool   `yaml:"enable,omitempty"`
	Runtime     bool   `yaml:"runtime,omitempty"`
	UnknownKeys `yaml:",inline"`
}

func (CustomSystemdUnit) ContentArray added in v0.9.6

func (c CustomSystemdUnit) ContentArray() []string

func (CustomSystemdUnit) EnableString added in v0.9.6

func (c CustomSystemdUnit) EnableString() string

func (CustomSystemdUnit) RuntimeString added in v0.9.6

func (c CustomSystemdUnit) RuntimeString() string

type DataVolume added in v0.9.6

type DataVolume struct {
	Size        int    `yaml:"size,omitempty"`
	Type        string `yaml:"type,omitempty"`
	IOPS        int    `yaml:"iops,omitempty"`
	Ephemeral   bool   `yaml:"ephemeral,omitempty"`
	Encrypted   bool   `yaml:"encrypted,omitempty"`
	UnknownKeys `yaml:",inline"`
}

type EC2Instance added in v0.9.6

type EC2Instance struct {
	Count         int    `yaml:"count,omitempty"`
	CreateTimeout string `yaml:"createTimeout,omitempty"`
	InstanceType  string `yaml:"instanceType,omitempty"`
	RootVolume    `yaml:"rootVolume,omitempty"`
	Tenancy       string `yaml:"tenancy,omitempty"`
}

type Etcd

type Etcd struct {
	Cluster            EtcdCluster          `yaml:",inline"`
	CustomFiles        []CustomFile         `yaml:"customFiles,omitempty"`
	CustomSystemdUnits []CustomSystemdUnit  `yaml:"customSystemdUnits,omitempty"`
	DataVolume         DataVolume           `yaml:"dataVolume,omitempty"`
	DisasterRecovery   EtcdDisasterRecovery `yaml:"disasterRecovery,omitempty"`
	EC2Instance        `yaml:",inline"`
	IAMConfig          IAMConfig    `yaml:"iam,omitempty"`
	Nodes              []EtcdNode   `yaml:"nodes,omitempty"`
	SecurityGroupIds   []string     `yaml:"securityGroupIds"`
	Snapshot           EtcdSnapshot `yaml:"snapshot,omitempty"`
	Subnets            []Subnet     `yaml:"subnets,omitempty"`
	UnknownKeys        `yaml:",inline"`
}

func NewDefaultEtcd added in v0.9.6

func NewDefaultEtcd() Etcd

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

func (Etcd) SecurityGroupRefs added in v0.9.6

func (e Etcd) SecurityGroupRefs() []string

func (Etcd) SystemdUnitName added in v0.9.6

func (e Etcd) SystemdUnitName() string

func (Etcd) Version added in v0.9.6

func (e Etcd) Version() EtcdVersion

Version returns the version of etcd (e.g. `3.2.1`) to be used for this etcd cluster

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"`
	Version                EtcdVersion `yaml:"version,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 EtcdDisasterRecovery added in v0.9.6

type EtcdDisasterRecovery struct {
	Automated bool `yaml:"automated,omitempty"`
}

func (EtcdDisasterRecovery) IsAutomatedForEtcdVersion added in v0.9.6

func (r EtcdDisasterRecovery) IsAutomatedForEtcdVersion(etcdVersion EtcdVersion) bool

func (EtcdDisasterRecovery) SupportsEtcdVersion added in v0.9.6

func (r EtcdDisasterRecovery) SupportsEtcdVersion(etcdVersion EtcdVersion) bool

Supported returns true when the disaster recovery feature provided by etcdadm can be enabled on the specified version of etcd

type EtcdNode

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

type EtcdSnapshot added in v0.9.6

type EtcdSnapshot struct {
	Automated bool `yaml:"automated,omitempty"`
}

func (EtcdSnapshot) IsAutomatedForEtcdVersion added in v0.9.6

func (s EtcdSnapshot) IsAutomatedForEtcdVersion(etcdVersion EtcdVersion) bool

type EtcdVersion added in v0.9.6

type EtcdVersion string

func (EtcdVersion) Is3 added in v0.9.6

func (v EtcdVersion) Is3() bool

func (EtcdVersion) String added in v0.9.6

func (v EtcdVersion) String() string

type FeatureGates added in v0.9.8

type FeatureGates map[string]string

func (FeatureGates) Enabled added in v0.9.8

func (l FeatureGates) Enabled() bool

func (FeatureGates) String added in v0.9.8

func (l FeatureGates) String() string

Returns key=value pairs separated by ',' to be passed to kubelet's `--feature-gates` flag

type Gpu added in v0.9.7

type Gpu struct {
	Nvidia NvidiaSetting `yaml:"nvidia"`
}

func (Gpu) Validate added in v0.9.8

func (c Gpu) Validate(instanceType string) error

type HostedZone added in v0.9.6

type HostedZone struct {
	// Identifier should include the hosted zone ID for a private or public hosted zone,
	// to make DNS names available to an internal network or the internet respectively
	Identifier `yaml:",inline"`
}

HostedZone is a AWS Route 53 hosted zone in which record sets are created. Record sts are created to register DNS records to make various DNS names of nodes and/or load LBs managed by kube-aws visible to an internal network or the internet

type IAMConfig added in v0.9.7

type IAMConfig struct {
	Role            IAMRole            `yaml:"role,omitempty"`
	InstanceProfile IAMInstanceProfile `yaml:"instanceProfile,omitempty"`
	UnknownKeys     `yaml:",inline"`
	Policy          IAMPolicy
}

func (IAMConfig) Validate added in v0.9.7

func (c IAMConfig) Validate() error

type IAMInstanceProfile added in v0.9.7

type IAMInstanceProfile struct {
	ARN `yaml:",inline"`
}

type IAMManagedPolicy added in v0.9.7

type IAMManagedPolicy struct {
	ARN `yaml:",inline"`
}

type IAMPolicy added in v0.9.8

type IAMPolicy struct {
	// Statements is a list of IAM policy statements for the IAM policy associated to the nodes
	// Each statement must be a valid go text template producing a valid json object
	Statements IAMPolicyStatements `yaml:"statements,omitempty"`
}

type IAMPolicyStatement added in v0.9.8

type IAMPolicyStatement struct {
	Actions   []string `yaml:"actions,omitempty"`
	Effect    string   `yaml:"effect,omitempty"`
	Resources []string `yaml:"resources,omitempty"`
}

type IAMPolicyStatements added in v0.9.8

type IAMPolicyStatements []IAMPolicyStatement

type IAMRole added in v0.9.7

type IAMRole struct {
	ARN             `yaml:",inline"`
	Name            string             `yaml:"name,omitempty"`
	ManagedPolicies []IAMManagedPolicy `yaml:"managedPolicies,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

HasIdentifier returns true when the id of a resource i.e. either `id` or `idFromStackOutput` is specified

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:"rootVolume,omitempty"`
}

func NewLaunchSpecification

func NewLaunchSpecification(weightedCapacity int, instanceType string) LaunchSpecification

func (*LaunchSpecification) UnmarshalYAML added in v0.9.6

func (s *LaunchSpecification) UnmarshalYAML(unmarshal func(interface{}) error) error

func (LaunchSpecification) Validate added in v0.9.8

func (c LaunchSpecification) Validate() 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 NodeDrainer added in v0.9.7

type NodeDrainer struct {
	Enabled      bool `yaml:"enabled"`
	DrainTimeout int  `yaml:"drainTimeout"`
}

func (*NodeDrainer) DrainTimeoutInSeconds added in v0.9.7

func (nd *NodeDrainer) DrainTimeoutInSeconds() int

func (*NodeDrainer) Validate added in v0.9.8

func (nd *NodeDrainer) Validate() error

type NodeLabels added in v0.9.7

type NodeLabels map[string]string

func (NodeLabels) Enabled added in v0.9.7

func (l NodeLabels) Enabled() bool

func (NodeLabels) String added in v0.9.7

func (l NodeLabels) String() string

Returns key=value pairs separated by ',' to be passed to kubelet's `--node-labels` flag

type NodePoolConfig

type NodePoolConfig struct {
	Autoscaling               Autoscaling      `yaml:"autoscaling,omitempty"`
	AutoScalingGroup          AutoScalingGroup `yaml:"autoScalingGroup,omitempty"`
	SpotFleet                 SpotFleet        `yaml:"spotFleet,omitempty"`
	EC2Instance               `yaml:",inline"`
	IAMConfig                 IAMConfig              `yaml:"iam,omitempty"`
	SpotPrice                 string                 `yaml:"spotPrice,omitempty"`
	SecurityGroupIds          []string               `yaml:"securityGroupIds,omitempty"`
	CustomSettings            map[string]interface{} `yaml:"customSettings,omitempty"`
	VolumeMounts              []VolumeMount          `yaml:"volumeMounts,omitempty"`
	UnknownKeys               `yaml:",inline"`
	NodeSettings              `yaml:",inline"`
	NodeStatusUpdateFrequency string              `yaml:"nodeStatusUpdateFrequency"`
	CustomFiles               []CustomFile        `yaml:"customFiles,omitempty"`
	CustomSystemdUnits        []CustomSystemdUnit `yaml:"customSystemdUnits,omitempty"`
	Gpu                       Gpu                 `yaml:"gpu"`
}

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) Validate added in v0.9.8

func (c NodePoolConfig) Validate() error

type NodeSettings added in v0.9.8

type NodeSettings struct {
	FeatureGates FeatureGates `yaml:"featureGates"`
	NodeLabels   NodeLabels   `yaml:"nodeLabels"`
	Taints       Taints       `yaml:"taints"`
}

func (NodeSettings) Validate added in v0.9.8

func (s NodeSettings) Validate() error

type NvidiaSetting added in v0.9.7

type NvidiaSetting struct {
	Enabled bool   `yaml:"enabled,omitempty"`
	Version string `yaml:"version,omitempty"`
}

func (NvidiaSetting) IsEnabledOn added in v0.9.7

func (c NvidiaSetting) IsEnabledOn(instanceType string) bool

This function is used when rendering cloud-config-worker

type Oidc added in v0.9.8

type Oidc struct {
	Enabled       bool   `yaml:"enabled"`
	IssuerUrl     string `yaml:"issuerUrl"`
	ClientId      string `yaml:"clientId"`
	UsernameClaim string `yaml:"usernameClaim"`
	GroupsClaim   string `yaml:"groupsClaim,omitempty"`
}

type PartDesc added in v0.9.7

type PartDesc struct {
	// contains filtered or unexported fields
}

type PluginConfig added in v0.9.8

type PluginConfig struct {
	Enabled bool `yaml:"enabled,omitempty"`
	Values  `yaml:",inline"`
}

type PluginConfigs added in v0.9.8

type PluginConfigs map[string]PluginConfig

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 Rescheduler added in v0.9.6

type Rescheduler struct {
	Enabled     bool `yaml:"enabled"`
	UnknownKeys `yaml:",inline"`
}

type RootVolume

type RootVolume struct {
	Size        int    `yaml:"size,omitempty"`
	Type        string `yaml:"type,omitempty"`
	IOPS        int    `yaml:"iops,omitempty"`
	UnknownKeys `yaml:",inline"`
}

func NewGp2RootVolume

func NewGp2RootVolume(size int) RootVolume

func NewIo1RootVolume

func NewIo1RootVolume(size int, iops int) RootVolume

func (RootVolume) RootVolumeIOPS

func (v RootVolume) RootVolumeIOPS() int

func (RootVolume) RootVolumeSize

func (v RootVolume) RootVolumeSize() int

func (RootVolume) RootVolumeType

func (v RootVolume) RootVolumeType() string

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 S3Folder added in v0.9.6

type S3Folder struct {
	// contains filtered or unexported fields
}

func (S3Folder) Path added in v0.9.6

func (f S3Folder) Path() string

func (S3Folder) URI added in v0.9.6

func (f S3Folder) URI() string

type S3Folders added in v0.9.6

type S3Folders struct {
	// contains filtered or unexported fields
}

func NewS3Folders added in v0.9.6

func NewS3Folders(s3URI string, clusterName string) S3Folders

func (S3Folders) Cluster added in v0.9.6

func (n S3Folders) Cluster() S3Folder

func (S3Folders) ClusterBackups added in v0.9.6

func (n S3Folders) ClusterBackups() S3Folder

func (S3Folders) ClusterExportedStacks added in v0.9.6

func (n S3Folders) ClusterExportedStacks() S3Folder

type SecurityGroup added in v0.9.6

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

SecurityGroup references one of existing security groups in your AWS account

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) UnmarshalYAML added in v0.9.6

func (f *SpotFleet) UnmarshalYAML(unmarshal func(interface{}) error) error

func (SpotFleet) Validate added in v0.9.8

func (c SpotFleet) Validate() error

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 SubnetReference added in v0.9.6

type SubnetReference struct {
	// Name is the unique name of subnet to be referenced.
	// The subnet referenced by this name should be defined in the `subnets[]` field in the top-level of cluster.yaml
	Name string `yaml:"name,omitempty"`
}

SubnetReference references one of subnets defined in the top-level of cluster.yaml

type SystemdMessageResponse added in v0.9.8

type SystemdMessageResponse struct {
	InstanceId  string `json:"instanceId,omitempty"`
	Hostname    string `json:"hostname,omitempty"`
	CmdName     string `json:"cmdName,omitempty"`
	Exe         string `json:"exe,omitempty"`
	CmdLine     string `json:"cmdLine,omitempty"`
	SystemdUnit string `json:"systemdUnit,omitempty"`
	Priority    string `json:"priority,omitempty"`
	Message     string `json:"message,omitempty"`
}

type Taint added in v0.9.6

type Taint struct {
	Key    string `yaml:"key"`
	Value  string `yaml:"value"`
	Effect string `yaml:"effect"`
}

Taint is a k8s node taint which is added to nodes which requires pods to tolerate

func (Taint) String added in v0.9.6

func (t Taint) String() string

String returns a taint represented in string

func (Taint) Validate added in v0.9.8

func (t Taint) Validate() error

Validate returns an error if the taint is invalid

type Taints added in v0.9.6

type Taints []Taint

Taints is a list of taints

func (Taints) String added in v0.9.6

func (t Taints) String() string

String returns a comma-separated list of taints

func (Taints) Validate added in v0.9.8

func (t Taints) Validate() error

Validate returns an error if the list of taints are invalid as a group

type UnknownKeys

type UnknownKeys map[string]interface{}

func (UnknownKeys) FailWhenUnknownKeysFound

func (unknownKeys UnknownKeys) FailWhenUnknownKeysFound(keyPath string) error

type UserData added in v0.9.7

type UserData struct {
	Parts map[string]*UserDataPart
}

UserData represents userdata which might be split across multiple storage types

func NewUserData added in v0.9.7

func NewUserData(templateFile string, context interface{}, opts ...UserDataOption) (UserData, error)

NewUserData creates userdata struct from template file. Template file is expected to have defined subtemplates (Parts) which are of various part and storage types

type UserDataOption added in v0.9.7

type UserDataOption func(*userDataOpt)

func UserDataPartsOpt added in v0.9.7

func UserDataPartsOpt(Parts ...PartDesc) UserDataOption

Parts to find in UserData template file

type UserDataPart added in v0.9.7

type UserDataPart struct {
	Asset Asset
	// contains filtered or unexported fields
}

func (UserDataPart) Base64 added in v0.9.7

func (self UserDataPart) Base64(compress bool, extra ...map[string]interface{}) (string, error)

func (UserDataPart) Template added in v0.9.7

func (self UserDataPart) Template(extra ...map[string]interface{}) (string, error)

type UserDataValidateFunc added in v0.9.7

type UserDataValidateFunc func(content []byte) error

UserDataValidateFunc returns error if templated Part content doesn't pass validation

type VPC added in v0.9.8

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

kube-aws manages at most one VPC per cluster If ID or IDFromStackOutput is non-zero, kube-aws doesn't manage the VPC 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 VPC, it must have an internet gateway attached and
  • A valid internet gateway ID must be provided via `internetGateway.id` or `internetGateway.idFromStackOutput`. In other words, kube-aws doesn't create an internet gateway in an existing VPC.

type Values added in v0.9.8

type Values map[string]interface{}

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