CKA · Question #27
Get IP address of the pod - "nginx-dev"
This simulation question tests your ability to use kubectl to inspect a running pod and retrieve its assigned IP address in a Kubernetes cluster.
Question
Explanation
This simulation question tests your ability to use kubectl to inspect a running pod and retrieve its assigned IP address in a Kubernetes cluster.
Approach. The correct approach is to run kubectl get pod nginx-dev -o wide which outputs pod details including the IP column, or use kubectl describe pod nginx-dev and look for the 'IP:' field in the output. A more targeted command is kubectl get pod nginx-dev -o jsonpath='{.status.podIP}' which extracts just the IP address. Any of these commands will return the pod's cluster-internal IP address assigned by the CNI plugin.
Concept tested. Kubernetes pod inspection using kubectl - specifically retrieving runtime metadata such as pod IP addresses using output flags like -o wide, -o json, or -o jsonpath.
Reference. kubectl Cheat Sheet: https://kubernetes.io/docs/reference/kubectl/cheatsheet/ - CKA/CKAD Exam Objective: Understand how to inspect and troubleshoot pods.
Topics
Community Discussion
No community discussion yet for this question.