-
Notifications
You must be signed in to change notification settings - Fork 983
If the k8s application is pending, audit the status as well #7313
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7313 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 697 698 +1
Lines 43587 43656 +69
Branches 5893 5896 +3
======================================
- Misses 43587 43656 +69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (ApplicationState.isFailed(applicationState, supportPersistedAppState = true)) { | ||
| if (ApplicationState.isFailed( | ||
| applicationState, | ||
| supportPersistedAppState = true) || ApplicationState.PENDING == applicationState) { |
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.
just to make sure, this won't has side-effect on control flow? since the method getApplicationStateAndErrorFromPod is not only called by KubernetesApplicationAuditLogger, indirectly
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.
yes, no side-effect on control flow
pan3793
left a comment
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.
LGTM, if get a positive response from the query.
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.
Pull request overview
This pull request enhances Kubernetes application audit logging to include status information for pods in PENDING state. Previously, only failed applications had their detailed status audited, but pods stuck in pending state can also indicate issues that need diagnosis. The change enables the audit logger to capture PodStatus and ContainerStatus information when a Kubernetes pod is pending, similar to how YARN already captures diagnostics for all states including PENDING.
Changes:
- Modified the error collection condition in
getApplicationStateAndErrorFromPodto include PENDING state alongside failed states, enabling status auditing for pending pods
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
Outdated
Show resolved
Hide resolved
| Map("Pod" -> podName, "PodStatus" -> pod.getStatus) | ||
| } | ||
| Some(JsonUtils.toPrettyJson(errorMap.asJava)) | ||
| Some(JsonUtils.toJson(errorMap.asJava)) |
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.
for audit purpose, toPrettyJson(multi-lines) is not suitable
Why are the changes needed?
I saw that, a pod pending for 3 hours.
However, the audit log did not record that why the pod pending for so long time.
So, I think we should check the pod state if pod is pending.
Also, for yarn app, it would also return the app pending reason for example waiting for am allocation.
How was this patch tested?
Code review.
Was this patch authored or co-authored using generative AI tooling?
No.