Question 47 - List the InternalIP of all nodes of the cluster.
alochym01 opened this issue · comments
alochym01 commented
your suggestion is using jsonpath. Can you show me the cli to do that
for me, i resolved it by using custom-columns
hadn@master-1:~/github/StenlyTU/pod$ kubectl get node -o custom-columns="IP:.status.addresses[0].address, TYPE:.status.addresses[0].type"
IP TYPE
192.168.2.150 InternalIP
192.168.2.20 InternalIP
Stilian Stoilov commented
You can do it like this:
➜ ~ kubectl get nodes -o jsonpath='{..addresses[?(@.type=="InternalIP")].address}'
10.250.3.151