-
Notifications
You must be signed in to change notification settings - Fork 4
pod to pod connectivity
Yuriy Lesyuk edited this page Mar 18, 2020
·
1 revision
Find an IP address of a target container at dc2-cluster.
kubectl --context dc2-cluster -n apigee describe pod apigee-cassandra-0 | grep ^IP
IP: 10.32.4.10
Log into a shell at dc1-cluster
kubectl --context dc1-cluster -n apigee run --generator=run-pod/v1 --image=alpine:3.5 -it alpine-shell -- /bin/sh
While at the prompt, do whatever is appropriate
/ # ping 10.32.4.10
PING 10.32.4.10 (10.32.4.10): 56 data bytes
64 bytes from 10.32.4.10: seq=0 ttl=62 time=186.086 ms
64 bytes from 10.32.4.10: seq=1 ttl=62 time=184.884 ms
64 bytes from 10.32.4.10: seq=2 ttl=62 time=184.814 ms
^C
--- 10.32.4.10 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 184.814/185.261/186.086 ms
exit
Reattach to the alpine pod later if required
kubectl --context dc1-cluster -n apigee attach alpine-shell -c alpine-shell -i -t
...or delete it when finished
kubectl --context dc1-cluster -n apigee delete pod alpine-shell
pod "alpine-shell" deleted
Adapted from: https://github.com/cockroachdb/cockroach/tree/master/cloud/kubernetes/multiregion#pod-to-pod-connectivity