Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto_scaling_group asg failed multi line warn log #7703

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Fix auto_scaling_group asg failed multi line warn log
krrrr38 committed Jan 16, 2025
commit 13e6a8c22804b662a719ba5645c1bc5adf506800
Original file line number Diff line number Diff line change
@@ -548,7 +548,7 @@ func (m *asgCache) isNodeGroupAvailable(group *autoscaling.Group) (bool, error)
if activity.StartTime.Before(lut) {
break
} else if *activity.StatusCode == "Failed" {
klog.Warningf("ASG %s scaling failed with %s", asgRef.Name, *activity)
klog.Warningf("ASG %s scaling failed with %s", asgRef.Name, *activity.StatusMessage)
Copy link
Author

@krrrr38 krrrr38 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASG Name is already shown, so we may require only StatusMessage only. And this become single line output.

W0116 07:10:42.815402       1 auto_scaling_groups.go:551] ASG eks-batch-spot202407091400-ap-northeast-1a-72c85d24-0d0c-3317-6d99-xxxxxxxxxxxx scaling failed with {
  ActivityId: "4b6651b7-c98a-a0c3-5fe1-xxxxxxxxxxxx",
  AutoScalingGroupARN: "arn:aws:autoscaling:ap-northeast-1:xxxxxxxxxxxx:autoScalingGroup:15be2ddc-7564-4bf2-bb35-xxxxxxxxxxxx:autoScalingGroupName/eks-batch-spot202407091400-ap-northeast-1a-72c85d24-0d0c-3317-6d99-xxxxxxxxxxxx",
  AutoScalingGroupName: "eks-batch-spot202407091400-ap-northeast-1a-72c85d24-0d0c-3317-6d99-xxxxxxxxxxxx",
  Cause: "At 2025-01-16T07:09:48Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.",
  Description: "Launching a new EC2 instance.  Status Reason: Could not launch Spot Instances. UnfulfillableCapacity - Unable to fulfill capacity due to your request configuration. Please adjust your request and try again. Launching EC2 instance failed.",
  Details: "{\"Subnet ID\":\"subnet-xxxxxxxxxxxx\",\"Availability Zone\":\"ap-northeast-1a\"}",
  EndTime: 2025-01-16 07:09:49 +0000 UTC,
  Progress: 100,
  StartTime: 2025-01-16 07:09:49.096 +0000 UTC,
  StatusCode: "Failed",
  StatusMessage: "Could not launch Spot Instances. UnfulfillableCapacity - Unable to fulfill capacity due to your request configuration. Please adjust your request and try again. Launching EC2 instance failed."
}

return false, nil
}
} else {
Original file line number Diff line number Diff line change
@@ -81,8 +81,9 @@ func TestCreatePlaceholders(t *testing.T) {
desiredCapacity: aws.Int64(1),
activities: []*autoscaling.Activity{
{
StatusCode: aws.String("Failed"),
StartTime: aws.Time(time.Unix(10, 0)),
StatusCode: aws.String("Failed"),
StartTime: aws.Time(time.Unix(10, 0)),
StatusMessage: aws.String("Something failed"),
},
},
groupLastUpdateTime: time.Unix(9, 0),