vpc

package
v0.63.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupNetworkInterfaces

func CleanupNetworkInterfaces(ec2API ec2iface.EC2API, spec *api.ClusterConfig) error

CleanupNetworkInterfaces finds and deletes any dangling ENIs

func EnsureMapPublicIPOnLaunchEnabled

func EnsureMapPublicIPOnLaunchEnabled(ec2API ec2iface.EC2API, subnetIDs []string) error

EnsureMapPublicIPOnLaunchEnabled will enable MapPublicIpOnLaunch in EC2 for all given subnet IDs

func ImportSubnets

func ImportSubnets(ec2API ec2iface.EC2API, spec *api.ClusterConfig, topology api.SubnetTopology, subnets []*ec2.Subnet) error

ImportSubnets will update spec with subnets, if VPC ID/CIDR is unknown it will use provider to call describeVPC based on the VPC ID of the first subnet; all subnets must be in the same VPC NOTE: it does respect all fields set in spec.VPC, and will error if there is a mismatch of local vs remote states

func ImportSubnetsFromIDList added in v0.39.0

func ImportSubnetsFromIDList(ec2API ec2iface.EC2API, spec *api.ClusterConfig, topology api.SubnetTopology, subnetIDs []string) error

ImportSubnetsFromIDList will update spec with subnets _only specified by ID_ then pass resulting subnets to ImportSubnets NOTE: it does respect all fields set in spec.VPC, and will error if there is a mismatch of local vs remote states

func ImportSubnetsFromSpec added in v0.39.0

func ImportSubnetsFromSpec(provider api.ClusterProvider, spec *api.ClusterConfig) error

ImportSubnetsFromSpec will update spec with subnets, it will call describeSubnets first, then pass resulting subnets to ImportSubnets NOTE: it does respect all fields set in spec.VPC, and will error if there is a mismatch of local vs remote states

func SelectNodeGroupSubnets

func SelectNodeGroupSubnets(nodegroupAZs, nodegroupSubnets []string, subnets api.AZSubnetMapping, ec2API ec2iface.EC2API, vpcID string) ([]string, error)

func SetSubnets

func SetSubnets(vpc *api.ClusterVPC, availabilityZones []string) error

SetSubnets defines CIDRs for each of the subnets, it must be called after SetAvailabilityZones

func SplitInto16

func SplitInto16(parent *net.IPNet) ([]*net.IPNet, error)

func SplitInto8

func SplitInto8(parent *net.IPNet) ([]*net.IPNet, error)

func UseEndpointAccessFromCluster

func UseEndpointAccessFromCluster(provider api.ClusterProvider, spec *api.ClusterConfig) error

UseEndpointAccessFromCluster retrieves the Cluster's endpoint access configuration via the SDK as the CloudFormation Stack doesn't support that configuration currently

func UseFromClusterStack added in v0.40.0

func UseFromClusterStack(provider api.ClusterProvider, stack *cfn.Stack, spec *api.ClusterConfig) error

UseFromClusterStack retrieves the VPC configuration from an existing cluster based on stack outputs NOTE: it doesn't expect any fields in spec.VPC to be set, the remote state is treated as the source of truth

func ValidateExistingPublicSubnets

func ValidateExistingPublicSubnets(provider api.ClusterProvider, vpcID string, subnetIDs []string) error

ValidateExistingPublicSubnets makes sure that subnets have the property MapPublicIpOnLaunch enabled

func ValidateLegacySubnetsForNodeGroups

func ValidateLegacySubnetsForNodeGroups(spec *api.ClusterConfig, provider api.ClusterProvider) error

Types

type Importer added in v0.40.0

type Importer interface {
	VPC() *gfnt.Value
	ClusterSecurityGroup() *gfnt.Value
	ControlPlaneSecurityGroup() *gfnt.Value
	SharedNodeSecurityGroup() *gfnt.Value
	SecurityGroups() gfnt.Slice
	SubnetsPublic() *gfnt.Value
	SubnetsPrivate() *gfnt.Value
}

type SpecConfigImporter added in v0.40.0

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

SpecConfigImporter returns VPC info based on the ClusterConfig Spec

func NewSpecConfigImporter added in v0.40.0

func NewSpecConfigImporter(securityGroup string, vpc *api.ClusterVPC) *SpecConfigImporter

NewSpecConfigImporter creates a new SpecConfigImporter instance

func (*SpecConfigImporter) ClusterSecurityGroup added in v0.40.0

func (si *SpecConfigImporter) ClusterSecurityGroup() *gfnt.Value

ClusterSecurityGroup returns the gftn value of the default cluser security group

func (*SpecConfigImporter) ControlPlaneSecurityGroup added in v0.40.0

func (si *SpecConfigImporter) ControlPlaneSecurityGroup() *gfnt.Value

ControlPlaneSecurityGroup returns the gftn value of the cluster config VPC securityGroup

func (*SpecConfigImporter) SecurityGroups added in v0.40.0

func (si *SpecConfigImporter) SecurityGroups() gfnt.Slice

SecurityGroups returns a gftn slice of the ControlPlaneSecurityGroup and the ClusterSecurityGroup

func (*SpecConfigImporter) SharedNodeSecurityGroup added in v0.40.0

func (si *SpecConfigImporter) SharedNodeSecurityGroup() *gfnt.Value

SharedNodeSecurityGroup returns the gftn value of the cluster config VPC sharedNodeSecurityGroup if it is set. If not, it returns the default cluster security group

func (*SpecConfigImporter) SubnetsPrivate added in v0.40.0

func (si *SpecConfigImporter) SubnetsPrivate() *gfnt.Value

SubnetsPrivate returns a gftn string slice of the Private subnets from the cluster config VPC subnets spec

func (*SpecConfigImporter) SubnetsPublic added in v0.40.0

func (si *SpecConfigImporter) SubnetsPublic() *gfnt.Value

SubnetsPublic returns a gftn string slice of the Public subnets from the cluster config VPC subnets spec

func (*SpecConfigImporter) VPC added in v0.40.0

func (si *SpecConfigImporter) VPC() *gfnt.Value

VPC returns the gftn value of the cluster config VPC ID

type StackConfigImporter added in v0.40.0

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

StackConfigImporter returns VPC info based on the Cluster Stack

func NewStackConfigImporter added in v0.40.0

func NewStackConfigImporter(clusterStackName string) *StackConfigImporter

NewStackConfigImporter creates a new StackConfigImporter instance

func (*StackConfigImporter) ClusterSecurityGroup added in v0.40.0

func (si *StackConfigImporter) ClusterSecurityGroup() *gfnt.Value

ClusterSecurityGroup returns a gftn value based on the cluster stack name and the default security group from the cluster stack output

func (*StackConfigImporter) ControlPlaneSecurityGroup added in v0.40.0

func (si *StackConfigImporter) ControlPlaneSecurityGroup() *gfnt.Value

ControlPlaneSecurityGroup returns a gftn value based on the cluster stack name and the control plane security group from the cluster stack output

func (*StackConfigImporter) SecurityGroups added in v0.40.0

func (si *StackConfigImporter) SecurityGroups() gfnt.Slice

SecurityGroups returns a gftn slice based on the cluster stack name and the default security group from the cluster stack output

func (*StackConfigImporter) SharedNodeSecurityGroup added in v0.40.0

func (si *StackConfigImporter) SharedNodeSecurityGroup() *gfnt.Value

SharedNodeSecurityGroup returns a gftn value based on the cluster stack name and the shared node security group from the cluster stack output

func (*StackConfigImporter) SubnetsPrivate added in v0.40.0

func (si *StackConfigImporter) SubnetsPrivate() *gfnt.Value

SubnetsPrivate returns a gftn value based on the cluster stack name and the public subnets from the cluster stack output

func (*StackConfigImporter) SubnetsPublic added in v0.40.0

func (si *StackConfigImporter) SubnetsPublic() *gfnt.Value

SubnetsPublic returns a gftn value based on the cluster stack name and the public subnets from the cluster stack output

func (*StackConfigImporter) VPC added in v0.40.0

func (si *StackConfigImporter) VPC() *gfnt.Value

VPC returns a gftn value based on the cluster stack name and the VPC from the cluster stack output

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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