-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[BUG] Use Pod.Status.Phase for pod updates in kubernetes autodiscovery #17223
[BUG] Use Pod.Status.Phase for pod updates in kubernetes autodiscovery #17223
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats.
d53603b
to
0c43a8e
Compare
Pinging @elastic/integrations-platforms (Team:Platforms) |
This looks good to me, any other opinion @vjsamuel @ChrsMark @blakerouse? |
jenkins test this please |
I don't think they are related to this change, so let's ignore them for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to set to request changes, only so an issue can be created and add an entry in the CHANGELOG.next.asciidoc
referencing this pull request.
Please file an issue for what this fixes so it can be tracked what this is solving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the issue and the changelog entry.
elastic#17223) * Use Pod.Status.Phase for pod updates in kubernetes autodiscovery This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats. * add issue PR reference to changelog (cherry picked from commit 70237a7)
elastic#17223) * Use Pod.Status.Phase for pod updates in kubernetes autodiscovery This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats. * add issue PR reference to changelog (cherry picked from commit 70237a7)
Thanks for the quick feedback on this one. |
Thank you for contributing!! |
#17223) (#17247) * Use Pod.Status.Phase for pod updates in kubernetes autodiscovery This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats. * add issue PR reference to changelog (cherry picked from commit 70237a7) Co-authored-by: Bruno Moura <brunotm@gmail.com>
#17223) (#17248) * Use Pod.Status.Phase for pod updates in kubernetes autodiscovery This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats. * add issue PR reference to changelog (cherry picked from commit 70237a7) Co-authored-by: Bruno Moura <brunotm@gmail.com>
elastic#17223) (elastic#17248) * Use Pod.Status.Phase for pod updates in kubernetes autodiscovery This change fixes several issues with filebeat loosing events when using kubernetes autodiscovery by incorrectly handling of pod states. Switch the pod status verification in OnUpdate() from ObjectMeta.DeletionTimestamp (which is present only for deleted pods) to Pod.Status.Phase in order to correctly handle pod states. ObjectMeta.DeletionTimestamp is only present for deleted pods and when a pod runs to completion (eg. pods generated by conjobs), OnUpdate() will emit a pod stop event disrespecting the CleanupTimeout leading to early termination of running beats. * add issue PR reference to changelog (cherry picked from commit b919f23) Co-authored-by: Bruno Moura <brunotm@gmail.com>
What does this PR do?
This change fixes several issues with beats loosing events when
using kubernetes autodiscovery by incorrectly handling of pod states.
Switch the pod status verification in OnUpdate() from
ObjectMeta.DeletionTimestamp (which is present only for deleted pods)
to Pod.Status.Phase in order to correctly handle pod states.
ObjectMeta.DeletionTimestamp is only present for deleted pods and when a
pod runs to completion (eg. pods generated by conjobs), OnUpdate()
will emit a pod stop event disrespecting the CleanupTimeout and leading to
early termination of running beats.
Why is it important?
Avoids missing log, audit and metrics data when using kubernetes autodiscovery.
Checklist
- [] I have made corresponding changes to the documentation- [] I have made corresponding change to the default configuration files- [] I have added tests that prove my fix is effective or that my feature worksFixes #17246