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.
You could use
kubectl describe pod `hostname` | grep IP | sed -E 's/IP:[[:space:]]+//'
which is based on what @mibbit suggested.
This takes the following facts into account:
kubectl
was manually placed in the container (possibly when the image was built)/var/run/secrets/kubernetes.io/serviceaccount
in the container