the MOCK EXAM answer is:
Check the following using jsonpath:
kubectl get nodes -o jsonpath=‘{.items[*].status.addresses[?(@.type==“InternalIP”)].address}’ > /root/CKA/node_ips
I ask, am I obliged to put one IP next to the other with space between the IPs or can I put \n after each IP?
I would use the following answer:
kubectl get nodes -o wide | awk 'NR>1 { print $6} ’
Would it be wrong because I put \n ? I always had this doubt.
thanks