Skip to content

add pods to webhook event and log pods on node #447

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

Merged
merged 2 commits into from
Jun 4, 2021
Merged

Conversation

bwagner5
Copy link
Contributor

@bwagner5 bwagner5 commented Jun 2, 2021

Issue #, if available:
N/A

Description of changes:

  • Add pod list to drain event (before it was only being added if cordon-only was enabled or rebalance events in IMDS mode)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bwagner5 bwagner5 requested review from imuqtadir and haugenj June 2, 2021 21:31
@@ -313,6 +313,15 @@ func drainOrCordonIfNecessary(interruptionEventStore *interruptioneventstore.Sto
} else {
cordonAndDrainNode(node, nodeName, metrics, recorder, nthConfig.EnableSQSTerminationDraining)
}
podNameList, err := node.FetchPodNameList(nodeName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this will slightly change the behavior - previously if the node didn't exist then this code wouldn't execute, but now that you've moved this block out of the else block from line 349, this can get ran when the node is gone.

Perhaps we should return errors from the cordonNode and cordonAndDrainNode funcs and then check against them here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to show the list of of pods during drain? My understanding was that these pods are being drained anyway so why care. I guess maybe they just want to maintain list of pods getting drained, is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I don't really see a reason not to. Only users that want it have to put it into their webhook template.

Copy link
Contributor

@haugenj haugenj left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants