builder

package
v0.59.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 31 Imported by: 17

Documentation

Index

Constants

View Source
const ManagedNodeGroupResourceName = "ManagedNodeGroup"

Variables

This section is empty.

Functions

func AbstractRoleNameFromARN

func AbstractRoleNameFromARN(arn string) string

AbstractRoleNameFromARN returns the role name from the ARN

func AssignSubnets

func AssignSubnets(spec *api.NodeGroupBase, vpcImporter vpc.Importer, clusterSpec *api.ClusterConfig) (*gfnt.Value, error)

AssignSubnets subnets based on the specified availability zones

func HasManagedNodesSG

func HasManagedNodesSG(stackResources *gjson.Result) bool

HasManagedNodesSG reports whether the stack has the security group required for communication between managed and unmanaged nodegroups

func MakeServiceRef

func MakeServiceRef(servicePrincipalName string) *gfnt.Value

MakeServiceRef returns a reference to an intrinsic map function that looks up the servicePrincipalName in servicePrincipalPartitionMappings

func NormalizeARN

func NormalizeARN(arn string) string

NormalizeARN returns the ARN with just the last element in the resource path preserved. If the input does not contain at least one forward-slash then the input is returned unmodified.

When providing an existing instanceRoleARN that contains a path other than "/", nodes may fail to join the cluster as the AWS IAM Authenticator does not recognize such ARNs declared in the aws-auth ConfigMap.

See: https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html#troubleshoot-container-runtime-network

Types

type ClusterResourceSet

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

ClusterResourceSet stores the resource information of the cluster

func NewClusterResourceSet

func NewClusterResourceSet(ec2API ec2iface.EC2API, region string, spec *api.ClusterConfig, supportsManagedNodes bool, existingStack *gjson.Result) *ClusterResourceSet

NewClusterResourceSet returns a resource set for the new cluster

func (*ClusterResourceSet) AddAllResources

func (c *ClusterResourceSet) AddAllResources() error

AddAllResources adds all the information about the cluster to the resource set

func (*ClusterResourceSet) GetAllOutputs

func (c *ClusterResourceSet) GetAllOutputs(stack cfn.Stack) error

GetAllOutputs collects all outputs of the cluster

func (*ClusterResourceSet) RenderJSON

func (c *ClusterResourceSet) RenderJSON() ([]byte, error)

RenderJSON returns the rendered JSON

func (*ClusterResourceSet) Template

func (c *ClusterResourceSet) Template() gfn.Template

Template returns the CloudFormation template

func (*ClusterResourceSet) WithIAM

func (c *ClusterResourceSet) WithIAM() bool

WithIAM states, if IAM roles will be created or not

func (*ClusterResourceSet) WithNamedIAM

func (c *ClusterResourceSet) WithNamedIAM() bool

WithNamedIAM states, if specifically named IAM roles will be created or not

type FargateResourceSet

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

FargateResourceSet manages only fargate resources

func NewFargateResourceSet

func NewFargateResourceSet(spec *api.ClusterConfig) *FargateResourceSet

NewFargateResourceSet returns a resource set for managing fargate resources

func (*FargateResourceSet) AddAllResources

func (rs *FargateResourceSet) AddAllResources() error

func (*FargateResourceSet) GetAllOutputs

func (rs *FargateResourceSet) GetAllOutputs(stack cfn.Stack) error

func (*FargateResourceSet) RenderJSON

func (rs *FargateResourceSet) RenderJSON() ([]byte, error)

func (*FargateResourceSet) WithIAM

func (rs *FargateResourceSet) WithIAM() bool

func (*FargateResourceSet) WithNamedIAM

func (rs *FargateResourceSet) WithNamedIAM() bool

type IAMRoleResourceSet

type IAMRoleResourceSet struct {
	OutputRole string
	// contains filtered or unexported fields
}

IAMRoleResourceSet holds IAM Role stack build-time information

func NewIAMRoleResourceSetForServiceAccount added in v0.39.0

func NewIAMRoleResourceSetForServiceAccount(spec *api.ClusterIAMServiceAccount, oidc *iamoidc.OpenIDConnectManager) *IAMRoleResourceSet

func NewIAMRoleResourceSetWithAttachPolicy

func NewIAMRoleResourceSetWithAttachPolicy(name, namespace, serviceAccount, permissionsBoundary string, attachPolicy api.InlineDocument, oidc *iamoidc.OpenIDConnectManager) *IAMRoleResourceSet

NewIAMRoleResourceSetWithAttachPolicy builds IAM Role stack from the give spec

func NewIAMRoleResourceSetWithAttachPolicyARNs

func NewIAMRoleResourceSetWithAttachPolicyARNs(name, namespace, serviceAccount, permissionsBoundary string, attachPolicyARNs []string, oidc *iamoidc.OpenIDConnectManager) *IAMRoleResourceSet

NewIAMRoleResourceSetWithAttachPolicyARNs builds IAM Role stack from the give spec

func (*IAMRoleResourceSet) AddAllResources

func (rs *IAMRoleResourceSet) AddAllResources() error

AddAllResources adds all resources for the stack

func (*IAMRoleResourceSet) GetAllOutputs

func (rs *IAMRoleResourceSet) GetAllOutputs(stack cfn.Stack) error

GetAllOutputs will get all outputs from iamserviceaccount stack

func (*IAMRoleResourceSet) RenderJSON

func (rs *IAMRoleResourceSet) RenderJSON() ([]byte, error)

RenderJSON will render iamserviceaccount stack as JSON

func (*IAMRoleResourceSet) WithIAM

func (*IAMRoleResourceSet) WithIAM() bool

WithIAM returns true

func (*IAMRoleResourceSet) WithNamedIAM

func (rs *IAMRoleResourceSet) WithNamedIAM() bool

WithNamedIAM returns false

type LaunchTemplateFetcher

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

LaunchTemplateFetcher fetches launch template data

func NewLaunchTemplateFetcher

func NewLaunchTemplateFetcher(fetcher launchTemplateFetcher) *LaunchTemplateFetcher

NewLaunchTemplateFetcher creates a new LaunchTemplateFetcher

func (*LaunchTemplateFetcher) Fetch

Fetch fetches the specified launch template

type ManagedNodeGroupResourceSet

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

ManagedNodeGroupResourceSet defines the CloudFormation resources required for a managed nodegroup

func NewManagedNodeGroup

func NewManagedNodeGroup(ec2API ec2iface.EC2API, cluster *api.ClusterConfig, nodeGroup *api.ManagedNodeGroup, launchTemplateFetcher *LaunchTemplateFetcher, bootstrapper nodebootstrap.Bootstrapper, forceAddCNIPolicy bool, vpcImporter vpc.Importer) *ManagedNodeGroupResourceSet

NewManagedNodeGroup creates a new ManagedNodeGroupResourceSet

func (*ManagedNodeGroupResourceSet) AddAllResources

func (m *ManagedNodeGroupResourceSet) AddAllResources() error

AddAllResources adds all required CloudFormation resources

func (ManagedNodeGroupResourceSet) GetAllOutputs

func (r ManagedNodeGroupResourceSet) GetAllOutputs(stack cfn.Stack) error

GetAllOutputs collects all outputs from an instance of an active stack, the outputs are defined by the current resourceSet

func (*ManagedNodeGroupResourceSet) RenderJSON

func (m *ManagedNodeGroupResourceSet) RenderJSON() ([]byte, error)

RenderJSON implements the ResourceSet interface

func (*ManagedNodeGroupResourceSet) WithIAM

func (m *ManagedNodeGroupResourceSet) WithIAM() bool

WithIAM implements the ResourceSet interface

func (*ManagedNodeGroupResourceSet) WithNamedIAM

func (m *ManagedNodeGroupResourceSet) WithNamedIAM() bool

WithNamedIAM implements the ResourceSet interface

type NodeGroupResourceSet

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

NodeGroupResourceSet stores the resource information of the nodegroup

func NewNodeGroupResourceSet

func NewNodeGroupResourceSet(ec2API ec2iface.EC2API, iamAPI iamiface.IAMAPI, spec *api.ClusterConfig, ng *api.NodeGroup, bootstrapper nodebootstrap.Bootstrapper, forceAddCNIPolicy bool, vpcImporter vpc.Importer) *NodeGroupResourceSet

NewNodeGroupResourceSet returns a resource set for a nodegroup embedded in a cluster config

func (*NodeGroupResourceSet) AddAllResources

func (n *NodeGroupResourceSet) AddAllResources() error

AddAllResources adds all the information about the nodegroup to the resource set

func (*NodeGroupResourceSet) GetAllOutputs

func (n *NodeGroupResourceSet) GetAllOutputs(stack cfn.Stack) error

GetAllOutputs collects all outputs of the nodegroup

func (*NodeGroupResourceSet) RenderJSON

func (n *NodeGroupResourceSet) RenderJSON() ([]byte, error)

RenderJSON returns the rendered JSON

func (*NodeGroupResourceSet) Template

func (n *NodeGroupResourceSet) Template() gfn.Template

Template returns the CloudFormation template

func (*NodeGroupResourceSet) WithIAM

func (n *NodeGroupResourceSet) WithIAM() bool

WithIAM states, if IAM roles will be created or not

func (*NodeGroupResourceSet) WithNamedIAM

func (n *NodeGroupResourceSet) WithNamedIAM() bool

WithNamedIAM states, if specifically named IAM roles will be created or not

type ResourceSet

type ResourceSet interface {
	AddAllResources() error
	WithIAM() bool
	WithNamedIAM() bool
	RenderJSON() ([]byte, error)
	GetAllOutputs(cfn.Stack) error
}

ResourceSet is an interface which cluster and nodegroup builders must implement

type SubnetResource added in v0.46.0

type SubnetResource struct {
	Subnet           *gfnt.Value
	RouteTable       *gfnt.Value
	AvailabilityZone string
}

type VPCEndpointResourceSet

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

A VPCEndpointResourceSet represents the resources required for VPC endpoints

func NewVPCEndpointResourceSet

func NewVPCEndpointResourceSet(ec2API ec2iface.EC2API, region string, rs *resourceSet, clusterConfig *api.ClusterConfig, vpc *gfnt.Value, subnets []SubnetResource, clusterSharedSG *gfnt.Value) *VPCEndpointResourceSet

NewVPCEndpointResourceSet creates a new VPCEndpointResourceSet

func (*VPCEndpointResourceSet) AddResources

func (e *VPCEndpointResourceSet) AddResources() error

AddResources adds resources for VPC endpoints

type VPCEndpointServiceDetails

type VPCEndpointServiceDetails struct {
	ServiceName         string
	ServiceReadableName string
	EndpointType        string
	AvailabilityZones   []string
}

VPCEndpointServiceDetails holds the details for a VPC endpoint service

type VPCResource

type VPCResource struct {
	VPC           *gfnt.Value
	SubnetDetails *subnetDetails
}

VPCResource represents a VPC resource

type VPCResourceSet

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

A VPCResourceSet builds the resources required for the specified VPC

func NewVPCResourceSet

func NewVPCResourceSet(rs *resourceSet, clusterConfig *api.ClusterConfig, ec2API ec2iface.EC2API) *VPCResourceSet

NewVPCResourceSet creates and returns a new VPCResourceSet

func (*VPCResourceSet) AddOutputs

func (v *VPCResourceSet) AddOutputs()

AddOutputs adds VPC resource outputs

func (*VPCResourceSet) AddResources

func (v *VPCResourceSet) AddResources() (*VPCResource, error)

AddResources adds all required resources

func (*VPCResourceSet) RenderJSON added in v0.46.0

func (v *VPCResourceSet) RenderJSON() ([]byte, error)

RenderJSON returns the rendered JSON

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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