To begin you will first need to get the ID of the pod whose IP address you are looking for using the command:
kubectl get pods
This will give you a list of pods your Kubernetes environment knows about along with status data. The
NAME column is the ID for each pod.
Then you can use the below command to get the IP address and additional data about the pod:
kubectl get pod reporting-app-deployment-8678d5688b-n2xvb -o wide
Using the above command without the option
-o wide would only have rendered the status data mentioned previously.
- How to use a secrets file for postgres credentials using Kubernetes
- When to use which service type in Kubernetes
- How to view the status data in a Kubernetes Deployment
- Create your first Rails app cluster with Kubernetes and Docker
- Kubernetes kubectl commands for newbies
- Kubernetes node processes explained
- Connecting Kubernetes Deployments to Pods
- Connecting Kubernetes Services to Deployments