I just want to list pods with their .status.podIP as an extra column.
It seems that as soon as I specify -o=custom-colums= the default columns NAME, READY, STATUS, RESTARTS, AGE will disappear.
The closest I was able to get is
kubectl get pod -o wide -o=custom-columns="NAME:.metadata.name,STATUS:.status.phase,RESTARTS:.status.containerStatuses[0].restartCount,PODIP:.status.podIP"
but that is not really equivalent to the the default columns in the following way:
- READY: I don't know how to get the default output (which looks like
2/2or0/1by using custom columns - STATUS: In the default behaviour STATUS, can be Running, Failed, Evicted, but
.status.phasewill never beEvicted. It seems that the default STATUS is a combination of.status.phaseand.status.reason. Is there a way to say show.status.phaseif it's Running but if not show.status.reason? - RESTARTS: This only shows the restarts of the first container in the pod (I guess the sum of all containers would be the correct one)
- AGE: Again I don't know how to get the age of the pod using custom-columns
Does anybody know the definitions of the default columns in custom-columns syntax?