daher:
Using kubectl, show only the pods IPs and health under the headers IP and HEALTH
Daz Mac:
Using the custom-columns output https://kubernetes.io/docs/reference/kubectl/cheatsheet/#formatting-output|https://kubernetes.io/docs/reference/kubectl/cheatsheet/#formatting-output
daher:
@Daz Mac i have tried, but didnt get…could you give me a syntax
Daz Mac:
I am not at a screen unfortunately
$ kubectl get pods <pod-name> -o=custom-columns=IP:.status.Xxxx,HEALTH:.status.Yyyy
You can use kubectl get pods -o json | jq -c ‘path(…)|[.[]|tostring]|join(“.”)’ command to work out what to put in the first command instead of Xxxx or Yyyy
daher:
no it didnt work, i tried this.
kubectl get pods --all-namespaces -o custom-columns=POD:metadata.name,PodIP:status.podIP
but still for health i dont see anything
Daz Mac:
metadata.name is wrong you need status.xxxx i believe
Daz Mac:
You need to work out what xxxx