ahmetb / kubectl-tree

kubectl plugin to browse Kubernetes object hierarchies as a tree 🎄 (star the repo if you are using)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kubectl tree command doesn't work for Statefulsets

Aracki opened this issue · comments

My kubectl tree sts node-bsc-03 command returns this:

NAMESPACE       NAME                                         READY  REASON  AGE
aws-blockchain  StatefulSet/node-bsc-03                      -              5d2h
aws-blockchain  ├─ControllerRevision/node-bsc-03-67ccb4f6cb  -              18h
aws-blockchain  ├─ControllerRevision/node-bsc-03-6b894df967  -              5d2h
aws-blockchain  ├─ControllerRevision/node-bsc-03-86f487dbb4  -              5d2h
aws-blockchain  ├─Pod/node-bsc-03-0                          True           5d2h
aws-blockchain  │ └─CiliumEndpoint/node-bsc-03-0             -              5d2h
aws-blockchain  └─Pod/node-bsc-03-1                          True           23m
aws-blockchain    └─CiliumEndpoint/node-bsc-03-1             -              23m

...although I'm pretty sure node-bsc-03-0 and node-bsc-03-1 are not booted from the same ControllerRevision objects.

If I run kubectl get sts node-bsc-03 -oyaml I can see the status:

status:
  availableReplicas: 2
  collisionCount: 0
  currentReplicas: 1
  currentRevision: node-bsc-03-6b894df967
  observedGeneration: 5
  readyReplicas: 2
  replicas: 2
  updateRevision: node-bsc-03-6b894df967
  updatedReplicas: 1

...after which it seems that the whole output of kubectl tree sts command is either wrongly sorted or something else is happening. Any clue?

It entirely depends on ownerReferences on each object.