Skip to content

Feature Request: List all containers (if --containers flag given) #52

@Dentrax

Description

@Dentrax

It would be great to list all containers for each Pod if --containers flag passed. Couldn't find a similar issue, so dropping this idea.

$ kubectl tree deployment foo

NAMESPACE  NAME                          READY  REASON  AGE
aa         Deployment/foo                -              21h
aa         └─ReplicaSet/foo-6f67dcc579   -              10m
aa           └─Pod/foo-6f67dcc579-znb55  True           10m

But we probably have to include a new column called RUNNING if aforementioned flag passed. (Not so sure about this) Like the following:

$ kubectl tree deployment foo --containers

NAMESPACE  NAME                              READY  RUNNING  REASON  AGE
aa         Deployment/foo                    -      -                21h
aa         └─ReplicaSet/foo-6f67dcc579       -      -                10m
aa           └─Pod/foo-6f67dcc579-znb55      True   -                10m
aa             └─Container/first-container   -      True
aa             └─Container/second-container  -      True

I've tried to pass pods into KIND to check whether it works:

$ kubectl tree pods foo-6f67dcc579-znb55
Error: ambiguous kind "pods". use one of these as the KIND disambiguate: [pods.v1., pods.v1beta1.metrics.k8s.io]

$ kubectl tree pods.v1 foo-6f67dcc579-znb55
Error: could not find api kind "pods.v1"

$ k api-resources | grep "pod"
pods                           po        v1                      true         Pod

But no luck. So decided to file an issue for further discussing. Thoughts?

cc @anilmisirlioglu @Abdulsametileri

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions