k8sgpt icon indicating copy to clipboard operation
k8sgpt copied to clipboard

[Feature]: Getting the error from event for Statefulset Analyzer

Open naveenthangaraj03 opened this issue 5 months ago • 2 comments

Checklist

  • [X] I've searched for similar issues and couldn't find anything matching
  • [X] I've discussed this feature request in the K8sGPT Slack and got positive feedback

Is this feature request related to a problem?

Yes

Problem Description

Screenshot 2024-09-18 124356

In above snapshot, there are two statefulset with 0/3 and 0/1, but k8sgpt displays no problem detected. From this we clearly identified that statefulset analyzer is not getting all the errors.

Solution Description

There are two scenario for this:

For some scenario the Statefulset has event if none of the pod is initialized for that we can get the lastest event and display as error and for some scenario which has no events which means some of the pod is initialized but it is in failed state for that we can get the error from the pod.

So that we get to know the clear error from the statefulset analyzer

Benefits

Previously, the statefulset analyzer is not scanning all the errors, if we get the error from this two scenarios we will get to know clear error about the statefulset.

Potential Drawbacks

No response

Additional Information

I have idea to resolve this,

we can check spec.replicas != status.availableReplicas then we can fetch the latest event and display as error or if the events is empty which means pod is initialized then we will print the error from some of the pod which is initialized because not in running state orelse we can get the event for the particular pod if you are ok.

naveenthangaraj03 avatar Sep 18 '24 09:09 naveenthangaraj03