Kubernetes assigns an IP address for each container, but how can I acquire the IP address from a container in the Pod? I couldn\'t find the way from documentations.
Even simpler to remember than the sed approach is to use awk.
sed
awk
Here is an example, which you can run on your local machine:
kubectl describe pod `` | grep IP | awk '{print $2}'
The IP itself is on column 2 of the output, hence $2 .
$2