List the InternalIP of all nodes of the cluster. Save the result to a file /root . . .

Venkat:
List the InternalIP of all nodes of the cluster. Save the result to a file /root/CKA/node_ips

Answer should be in the format: InternalIP of master<space>InternalIP of node1<space>InternalIP of node2<space>InternalIP of node3 (in a single line). Can anyone share the ans for this?

Sandeep Kumar:
Check the cheatsheet and replace ExternalIP to InternalIP.

Mohamed Ayman:
Check the following using jsonpath:
kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}' &gt; /root/CKA/node_ips

Rakesh Kumar Parida:
Another way is to custom-columns:

Rakesh Kumar Parida:
controlplane $ k get node -o custom-columns=NODENAME:.metadata.name,INTERNAL_IP:.status.addresses[].address
NODENAME INTERNAL_IP
controlplane 172.17.0.36node01 172.17.0.40