I am confused about some elementary network concept in k8s and can someone kindly explain this to me please? thank you!
as described here:
All ingress Pod-to-Pod communication has been denied across all namespaces. You want to allow the Pod busybox in namespace k1 to communicate with Pod nginx in namespace k2. You'll create a network policy to achieve that.
I create two pods in k1 and k2 separately in KIND cluster, and I didn't create any network policy, so I understand pod in k1 are not allowed to talk to pod in k2; and why am I seeing the wget is successful between the two pods here?
$k get ns k1 k2
NAME STATUS AGE
k1 Active 10m
k2 Active 10m
$k get pod -A -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
k1 busybox 1/1 Running 0 11m 10.244.0.5 t1-control-plane <none> <none>
k2 nginx 1/1 Running 0 11m 10.244.0.6 t1-control-plane <none> <none>
$k get NetworkPolicy -A
No resources found
$k exec -it busybox -n k1 -- wget --timeout=5 10.244.0.6:80
Connecting to 10.244.0.6:80 (10.244.0.6:80)
saving to 'index.html'
index.html 100% |********************************| 615 0:00:00 ETA
'index.html' saved