Commit 2037881
committed
[KYUUBI #7313] If the k8s application is pending, audit the status as well
### Why are the changes needed?
I saw that, a pod pending for 3 hours.
```
/var/log/hadoop/kyuubi/audit/k8s-audit.log.2026-01-23-08.gz::2026-01-23 08:09:31.356 INFO [-935552520-pool-3-thread-2861] org.apache.kyuubi.engine.KubernetesApplicationAuditLogger: eventType=UPDATE label=cb370310-9c4c-4982-817e-85f4f6c031a9 context=kube-apiserver-a-spark namespace=dls-prod pod=kyuubi-hadp-adi-hadp-w-md-tbl-location-w-muso-0-ae7bd346-20260123-stm-cb370310-9c4c-4982-817e-85f4f6c031a9-driver podState=Pending containers=[] appId=spark-f67cc33544654d828d36cc9553404a3e appName=hadp-adi-hadp-w-md-t-818abc6d23397c33859c76dff9aa82e7244a92ba appState=PENDING appError=''
/var/log/hadoop/kyuubi/audit/k8s-audit.log.2026-01-23-11.gz::2026-01-23 11:09:50.121 INFO [-935552520-pool-3-thread-2902] org.apache.kyuubi.engine.KubernetesApplicationAuditLogger: eventType=UPDATE label=cb370310-9c4c-4982-817e-85f4f6c031a9 context=kube-apiserver-a-spark namespace=dls-prod pod=kyuubi-hadp-adi-hadp-w-md-tbl-location-w-muso-0-ae7bd346-20260123-stm-cb370310-9c4c-4982-817e-85f4f6c031a9-driver podState=Pending containers=[] appId=spark-f67cc33544654d828d36cc9553404a3e appName=hadp-adi-hadp-w-md-t-818abc6d23397c33859c76dff9aa82e7244a92ba appState=PENDING appError=''
```
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.
Closes #7313 from turboFei/audit_k8s_pending.
Closes #7313
1faff5e [Wang, Fei] comments
b456a84 [Wang, Fei] If the k8s application is pending, audit the status as well
Authored-by: Wang, Fei <fwang12@ebay.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>1 parent 73882e5 commit 2037881
1 file changed
Lines changed: 4 additions & 2 deletions
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
664 | 666 | | |
665 | 667 | | |
666 | 668 | | |
| |||
670 | 672 | | |
671 | 673 | | |
672 | 674 | | |
673 | | - | |
| 675 | + | |
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
| |||
0 commit comments