Documentation ¶
Index ¶
- func GetInstances(machine *clusterv1.Machine, client Client, instanceStateFilter []*string, ...) ([]*ec2.Instance, error)
- func GetRunningInstances(machine *clusterv1.Machine, client Client, clusterId string) ([]*ec2.Instance, error)
- func SortInstances(instances []*ec2.Instance) (*ec2.Instance, []*ec2.Instance)
- func TerminateInstances(client Client, instances []*ec2.Instance, mLog log.FieldLogger) error
- type Actuator
- func (a *Actuator) Create(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error
- func (a *Actuator) CreateMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (*ec2.Instance, error)
- func (a *Actuator) Delete(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error
- func (a *Actuator) DeleteMachine(machine *clusterv1.Machine) error
- func (a *Actuator) Exists(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (bool, error)
- func (a *Actuator) GetIP(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (string, error)
- func (a *Actuator) GetKubeConfig(cluster *clusterv1.Cluster, master *clusterv1.Machine) (string, error)
- func (a *Actuator) Update(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error
- type Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInstances ¶
func GetInstances(machine *clusterv1.Machine, client Client, instanceStateFilter []*string, clusterId string) ([]*ec2.Instance, error)
GetInstances returns all instances that have a tag matching our machine name, and cluster ID.
func GetRunningInstances ¶
func GetRunningInstances(machine *clusterv1.Machine, client Client, clusterId string) ([]*ec2.Instance, error)
GetRunningInstances returns all running instances that have a tag matching our machine name, and cluster ID.
func SortInstances ¶
SortInstances will examine the given slice of instances and return the current active instance for the machine, as well as a slice of all other instances which the caller may want to terminate. The active instance is calculated as the most recently launched instance. This function should only be called with running instances, not those which are stopped or terminated.
func TerminateInstances ¶
TerminateInstances terminates all provided instances with a single EC2 request.
Types ¶
type Actuator ¶
type Actuator struct {
// contains filtered or unexported fields
}
Actuator is the AWS-specific actuator for the Cluster API machine controller
func NewActuator ¶
func NewActuator(kubeClient kubernetes.Interface, clusterClient clusterclient.Interface, logger *log.Entry, defaultAvailabilityZone string) *Actuator
NewActuator returns a new AWS Actuator
func (*Actuator) CreateMachine ¶
func (a *Actuator) CreateMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (*ec2.Instance, error)
CreateMachine starts a new AWS instance as described by the cluster and machine resources
func (*Actuator) DeleteMachine ¶
DeleteMachine deletes an AWS instance
func (*Actuator) Exists ¶
Exists determines if the given machine currently exists. For AWS we query for instances in running state, with a matching name tag, to determine a match.
func (*Actuator) GetKubeConfig ¶
func (a *Actuator) GetKubeConfig(cluster *clusterv1.Cluster, master *clusterv1.Machine) (string, error)
Implements ProviderDeployer
func (*Actuator) Update ¶
Update attempts to sync machine state with an existing instance. Today this just updates status for details that may have changed. (IPs and hostnames) We do not currently support making any changes to actual machines in AWS. Instead these will be replaced via MachineDeployments.
type Client ¶
type Client interface { DescribeImages(*ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) DescribeSecurityGroups(*ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error) RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error) }
Client is a wrapper object for actual AWS SDK clients to allow for easier testing.
func NewClient ¶
func NewClient(kubeClient kubernetes.Interface, mSpec *cov1.MachineSetSpec, namespace, region string) (Client, error)
NewClient creates our client wrapper object for the actual AWS clients we use. For authentication the underlying clients will use either the cluster AWS credentials secret if defined (i.e. in the root cluster), otherwise the IAM profile of the master where the actuator will run. (target clusters)