This one is rather useful, and again continues the use of jsonpath
Get the name of the all the nodes and their corresponding InternalIP address.
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}'
sideling2.example.com 10.51.12.45
No comments:
Post a Comment