eksctl-io / eksctl

The official CLI for Amazon EKS
https://eksctl.io
Other
4.83k stars 1.39k forks source link

[Feature] Add option to print specific events when running eksctl describe-stacks #6571

Closed TiberiuGC closed 11 months ago

TiberiuGC commented 1 year ago

When running eksctl utils describe-stacks command, the user has the options to provide --events flag in order to see a full event log as they would in the AWS Console. However, this could be considered noisy, depending on use case, and they may want to only filter for failed events. We could potentially provide this options via a new CLI flag e.g. --failed-only and filter by ResourceStatus only for the following types:

    ResourceStatusCreateFailed             ResourceStatus = "CREATE_FAILED"
    ResourceStatusDeleteFailed             ResourceStatus = "DELETE_FAILED"
    ResourceStatusUpdateFailed             ResourceStatus = "UPDATE_FAILED"
    ResourceStatusUpdateRollbackFailed     ResourceStatus = "UPDATE_ROLLBACK_FAILED"
    ResourceStatusRollbackFailed           ResourceStatus = "ROLLBACK_FAILED"

Note that we also run eksctl utils describe-stacks --events whenever an integration test spec fails, so adding this new flag there would probably be useful as-well.

Himangini commented 1 year ago

How about having a CLI flag called --resource-status that accepts one of the following values[case insensitive] and filters the results accordingly? 💡

"CREATE_FAILED"
"DELETE_FAILED"
"UPDATE_FAILED"
"UPDATE_ROLLBACK_FAILED"
"ROLLBACK_FAILED"
TiberiuGC commented 1 year ago

How about having a CLI flag called --resource-status that accepts one of the following values[case insensitive] and filters the results accordingly? 💡

"CREATE_FAILED"
"DELETE_FAILED"
"UPDATE_FAILED"
"UPDATE_ROLLBACK_FAILED"
"ROLLBACK_FAILED"

Yeah, I do like this one! 🚀

Himangini commented 1 year ago

We should note that this new flag should be used with --events flag. Not sure how useful it'll be on its own 😅

TiberiuGC commented 1 year ago

We should note that this new flag should be used with --events flag. Not sure how useful it'll be on its own 😅

Haha, we'll add some validations (and docs) for sure! 😄

TiberiuGC commented 1 year ago

Regarding integration tests - I've noticed that some of them use different cluster naming (e.g. trainium test) rather than the default params.ClusterName. This results in the stack events not being printed when the suite fails, and instead we're seeing Error: unable to describe cluster control plane: operation error EKS: DescribeCluster, https response error StatusCode: 404.

As part of this ticket, re-investigate all places in which we use params.LogStacksEventsOnFailure() and ensure proper cluster naming is being set.