k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Add support for describing containers

Open jsoref opened this issue 2 years ago • 3 comments




Is your feature request related to a problem? Please describe. I have a pod that hit CreateContainerConfigError. I can see that status in k9s, and I can open the container, but there's no describe container.

There was no way I could find the problem from k9s.

Describe the solution you'd like

  1. There should be a describe option for containers
  2. It'd be nice if describe for pods included the container status information

Describe alternatives you've considered

Additional context

I was able to find the problem by doing kubectl get -o json pod/... and I eventually saw:

    "containerStatuses": [
      {
        "image": ".../argocd:v2.5.6-...",
        "imageID": "",
        "lastState": {},
        "name": "application-controller",
        "ready": false,
        "restartCount": 0,
        "started": false,
        "state": {
          "waiting": {
            "message": "container has runAsNonRoot and image has non-numeric user (argocd), cannot verify user is non-root (pod: \"argocd-application-controller-0_argocd(22444eb2-7a20-4c0f-a85f-ae29be2d7d04)\", container: application-controller)",
            "reason": "CreateContainerConfigError"
          }
        }
      }
    ],

which helped me figure out the problem.

jsoref avatar Jan 19 '23 22:01 jsoref

@jsoref Thank you for this! I think if you yaml the pod it will show you the container statuses same as your json cmd. That is not included in the std describe either for kubectl nor k9s which uses the same call. Does this make sense?

derailed avatar Jan 19 '23 22:01 derailed

Oh, I know it was a royal pita to figure out what was the cause of this problem.

A describe for the container would have made it obvious. And optionally providing more information than the normal describe, especially if the pod is in this state would be wonderful, but not strictly necessary.

Obviously once you know what the cause is / how to see it, doing the same thing to investigate the same problem again later isn't a big deal.

Yes, there's no meaningful difference between yaml/json. I was using json because the folding tends to work better in some of my tools...

jsoref avatar Jan 19 '23 22:01 jsoref

Ran into a similar problem today, K9s is not able to describe the issue why container went into CreateContainerConfigError where as other IDEs like lens gives a better description.

advaitthakkar avatar Feb 12 '24 12:02 advaitthakkar