Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/services/autoscaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ imply an atomic transaction spanning Auto Scaling and EC2 after a process crash.
| `AttachLoadBalancerTargetGroups` | Attaches ELB v2 target group ARNs and registers the group's `InService` instances with the ones it adds, as AWS does; the reconciler registers each later instance as it comes into service |
| `DetachLoadBalancerTargetGroups` | Detaches target groups and deregisters the group's instances from them, as AWS does; a target group already deleted is detached all the same. An EKS nodegroup's node stays registered with a target group another nodegroup's group still has attached |
| `DescribeLoadBalancerTargetGroups` | Lists target groups attached to a group |
| `AttachLoadBalancers` | Classic ELB attachment (stored; no ELB v1 routing) |
| `DetachLoadBalancers` | Classic ELB detachment |
| `AttachLoadBalancers` | Attaches Classic Load Balancers by name and registers the group's `InService` instances with the ones it adds, as AWS does; the reconciler registers each later instance as it comes into service. Floci runs no Classic data plane ([Classic ELB](elb-classic.md)) |
| `DetachLoadBalancers` | Detaches Classic Load Balancers and deregisters the group's instances from them, as AWS does; a load balancer already deleted is detached all the same. An EKS nodegroup's node stays registered with a load balancer another nodegroup's group still has attached |
| `DescribeLoadBalancers` | Lists classic ELBs attached to a group |

### Traffic Sources

| Operation | Notes |
|---|---|
| `AttachTrafficSources` | Unified elb/elbv2/vpc-lattice attachment API; stored per identifier with its type. The group's `InService` instances are registered with an `elbv2` source it adds, as with a target group |
| `DetachTrafficSources` | Removes a traffic source by identifier, deregistering the group's instances from an `elbv2` source |
| `AttachTrafficSources` | Unified elb/elbv2/vpc-lattice attachment API; stored per identifier with its type. The group's `InService` instances are registered with an `elbv2` or `elb` source it adds, as with a target group or a Classic Load Balancer |
| `DetachTrafficSources` | Removes a traffic source by identifier, deregistering the group's instances from an `elbv2` or `elb` source |
| `DescribeTrafficSources` | Lists attached sources, optionally filtered by type; every source reports `InService` |

### Lifecycle Hooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ private void promoteReadyInstances(AutoScalingGroup asg) {
AutoScalingService.registerWithTargetGroups(elbV2Service, asg,
AutoScalingService.attachedTargetGroups(asg),
asgInst.getInstanceId(), returningFromStandby);
registerWithClassicLoadBalancers(asg, asgInst, returningFromStandby);
// Without this a Classic Load Balancer would stay empty, and a min_elb_capacity wait would never
// be satisfied.
AutoScalingService.registerWithClassicLoadBalancers(elbClassicService, asg,
AutoScalingService.attachedClassicLoadBalancers(asg), List.of(asgInst.getInstanceId()),
returningFromStandby);
asgInst.setLifecycleState("InService");
changed = true;
if (standbyActivityId != null) {
Expand Down Expand Up @@ -881,36 +885,6 @@ private static String statusMessage(Exception failure, String suffix) {
}


/**
* Registers a newly launched or returning instance with every Classic load balancer the group names.
*
* <p>An ASG attached through {@code LoadBalancerNames} feeds a Classic load balancer, not a
* target group, and the two lists are independent; a group can carry either or both. Without
* this the Classic load balancer would stay empty, and a {@code min_elb_capacity} wait would
* never be satisfied.
*/
private void registerWithClassicLoadBalancers(AutoScalingGroup asg, AsgInstance asgInst,
boolean returningFromStandby) {
if (elbClassicService == null) {
return;
}
for (String lbName : asg.getLoadBalancerNames()) {
try {
elbClassicService.registerInstances(asg.getRegion(), lbName,
List.of(asgInst.getInstanceId()));
LOG.debugv("ASG {0}: registered {1} with Classic ELB {2}",
asg.getAutoScalingGroupName(), asgInst.getInstanceId(), lbName);
} catch (Exception e) {
LOG.warnv(e, "ASG {0}: could not register {1} with Classic ELB {2}: {3}",
asg.getAutoScalingGroupName(), asgInst.getInstanceId(), lbName, e.getMessage());
if (returningFromStandby && !(e instanceof AwsException aws
&& "LoadBalancerNotFound".equals(aws.getErrorCode()))) {
throw e;
}
}
}
}

private LaunchSource resolveLaunchSource(AutoScalingGroup asg) {
LaunchConfiguration lc = resolveLaunchConfiguration(asg);
if (lc != null) {
Expand Down
Loading
Loading