Skip to content

Commit 9060041

Browse files
authored
Merge pull request #34457 from chetak123/change_grep
updated grep with custom-columns=POD_IP:.status.podIPs
2 parents 7a7a165 + 992cfb1 commit 9060041

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

content/en/docs/concepts/services-networking/connect-applications-service.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ my-nginx-3800858182-kna2y 1/1 Running 0 13s 10.244.2.5
4545
Check your pods' IPs:
4646

4747
```shell
48-
kubectl get pods -l run=my-nginx -o yaml | grep podIP
49-
podIP: 10.244.3.4
50-
podIP: 10.244.2.5
48+
kubectl get pods -l run=my-nginx -o custom-columns=POD_IP:.status.podIPs
49+
POD_IP
50+
[map[ip:10.244.3.4]]
51+
[map[ip:10.244.2.5]]
5152
```
5253
5354
You should be able to ssh into any node in your cluster and use a tool such as `curl` to make queries against both IPs. Note that the containers are *not* using port 80 on the node, nor are there any special NAT rules to route traffic to the pod. This means you can run multiple nginx pods on the same node all using the same `containerPort`, and access them from any other pod or node in your cluster using the assigned IP address for the Service. If you want to arrange for a specific port on the host Node to be forwarded to backing Pods, you can - but the networking model should mean that you do not need to do so.

0 commit comments

Comments
 (0)