Documentation
¶
Index ¶
- Constants
- func WithRetry[T any](ctx context.Context, cfg RetryConfig, fn func() (T, error)) (T, error)
- type AWS
- type ByCreationDate
- type ClusterCache
- type ImageInfo
- type InstanceInfo
- type NodeRole
- type Option
- type Provider
- func (p *Provider) Create() error
- func (p *Provider) CreateCluster() error
- func (p *Provider) Delete() error
- func (p *Provider) DryRun() error
- func (p *Provider) IsMultinode() bool
- func (p *Provider) Name() string
- func (p *Provider) Status() ([]metav1.Condition, error)
- func (p *Provider) UpdateResourcesTags(tags map[string]string, resources ...string) error
- type ResolvedImage
- type RetryConfig
Constants ¶
const ( // Name of this builder provider Name = "aws" VpcID string = "vpc-id" SubnetID string = "subnet-id" InternetGwID string = "internet-gateway-id" InternetGatewayAttachment string = "internet-gateway-attachment-vpc-id" RouteTable string = "route-table-id" SecurityGroupID string = "security-group-id" InstanceID string = "instance-id" PublicDnsName string = "public-dns-name" // Cluster networking cache keys PublicSubnetID string = "public-subnet-id" NatGatewayID string = "nat-gateway-id" PrivateRouteTable string = "private-route-table-id" PublicRouteTable string = "public-route-table-id" CPSecurityGroupID string = "cp-security-group-id" WorkerSecurityGroupID string = "worker-security-group-id" EIPAllocationID string = "eip-allocation-id" IAMInstanceProfileArn string = "iam-instance-profile-arn" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AWS ¶
type AWS struct {
Vpcid string
Subnetid string
InternetGwid string
InternetGatewayAttachment string
RouteTable string
SecurityGroupid string
Instanceid string
PublicDnsName string
// Cluster networking fields
PublicSubnetid string
NatGatewayid string
PublicRouteTable string
CPSecurityGroupid string
WorkerSecurityGroupid string
EIPAllocationid string
IAMInstanceProfileArn string
}
type ByCreationDate ¶ added in v0.2.0
type ByCreationDate []ImageInfo
func (ByCreationDate) Len ¶ added in v0.2.0
func (a ByCreationDate) Len() int
func (ByCreationDate) Less ¶ added in v0.2.0
func (a ByCreationDate) Less(i, j int) bool
func (ByCreationDate) Swap ¶ added in v0.2.0
func (a ByCreationDate) Swap(i, j int)
type ClusterCache ¶ added in v0.3.0
type ClusterCache struct {
AWS
// ControlPlaneInstances holds instance IDs for control-plane nodes
ControlPlaneInstances []InstanceInfo
// WorkerInstances holds instance IDs for worker nodes
WorkerInstances []InstanceInfo
// LoadBalancerArn is the ARN of the NLB for HA control plane
LoadBalancerArn string
// LoadBalancerDNS is the DNS name of the load balancer
LoadBalancerDNS string
// TargetGroupArn is the ARN of the target group for the load balancer
TargetGroupArn string
}
ClusterCache extends AWS cache with multinode-specific resources
type InstanceInfo ¶ added in v0.3.0
type InstanceInfo struct {
InstanceID string
PublicIP string
PrivateIP string
PublicDNS string
NetworkInterface string
Role string // "control-plane" or "worker"
Name string
SSHUsername string // SSH username for this node's OS (e.g., "ubuntu", "ec2-user")
}
InstanceInfo holds information about a single instance
type NodeRole ¶ added in v0.3.0
type NodeRole string
NodeRole represents the role of a node in the cluster
type Option ¶ added in v0.3.0
type Option func(*Provider)
Option is a functional option for configuring the Provider.
func WithAMIResolver ¶ added in v0.3.0
WithAMIResolver sets a custom AMI resolver for the Provider. This is primarily used for testing.
func WithEC2Client ¶ added in v0.3.0
func WithEC2Client(client internalaws.EC2Client) Option
WithEC2Client sets a custom EC2 client for the Provider. This is primarily used for testing to inject mock clients.
func WithELBv2Client ¶ added in v0.3.0
func WithELBv2Client(client internalaws.ELBv2Client) Option
WithELBv2Client sets a custom ELBv2 client for the Provider. This is primarily used for testing to inject mock clients.
func WithSSMClient ¶ added in v0.3.0
func WithSSMClient(client internalaws.SSMClient) Option
WithSSMClient sets a custom SSM client for the Provider. This is primarily used for testing to inject mock clients.
type Provider ¶ added in v0.2.0
type Provider struct {
Tags []types.Tag
*v1alpha1.Environment
// contains filtered or unexported fields
}
func New ¶
func New(log *logger.FunLogger, env v1alpha1.Environment, cacheFile string, opts ...Option) (*Provider, error)
New creates a new AWS Provider with the given configuration. Optional functional options can be provided to customize the provider, such as injecting a mock EC2 client for testing.
func (*Provider) Create ¶ added in v0.2.0
Create creates an EC2 instance with proper Network configuration VPC, Subnet, Internet Gateway, Route Table, Security Group If the environment specifies a cluster configuration, it delegates to CreateCluster()
func (*Provider) CreateCluster ¶ added in v0.3.0
CreateCluster creates a multinode cluster with the specified configuration
func (*Provider) Delete ¶ added in v0.2.0
Delete deletes the EC2 instance and all associated resources
func (*Provider) IsMultinode ¶ added in v0.3.0
IsMultinode returns true if the environment is configured for multinode cluster
type ResolvedImage ¶ added in v0.3.0
type ResolvedImage struct {
ImageID string
SSHUsername string
Architecture string // EC2 architecture: "x86_64" or "arm64"
}
ResolvedImage contains the resolved AMI information for instance creation.
type RetryConfig ¶ added in v0.3.0
RetryConfig configures retry behavior
func DefaultRetryConfig ¶ added in v0.3.0
func DefaultRetryConfig() RetryConfig
DefaultRetryConfig returns the default retry configuration