为什么部署在两个不同命名空间的 Kube 对象能够相互通信

Why Kube Objects deployed on two different namespace are able to communicate with each other

我是 Kubernetes 的新手,有一个与我正在尝试练习的部署相关的问题。所以这是场景 ::

 - I have two namespace :: n1 and n2 
 - I have a curl pod deployed at n1 I
 - have a nginx service of type Nodeport running at n2. My service has  
   exposed a deployment that is managing the pod

My question is, though the two resources are running in two different namespace why is my curl pod running in n1 is able to curl service running at n2 with its IP?ie 

[ k exec curl -n n1 -- curl http://18.108.65.98:8080]
[ k exec curl -n n1 -- curl http://my-nginx.n2:8080 ]

这是预期的行为吗?如果是,那么当两个不同命名空间中的两个服务 运行 尝试通信但无法通信时,为什么这种行为不同。

Why do we have to then set the RBAC access for them to communicate.

无论命名空间如何,pod 都可以通过 IP 相互通信。通常或在实际部署中,Pods 通过服务相互通信,服务可以是 CLUSTERIP、NODEPORT 或 LOADBALANCER 类型,具体取决于要求。 Yon 还可以通过格式为 :-

的 DNS 名称访问服务
<service-name>.<service-namespace>.svc.cluster.local

当部署在两个不同命名空间的 POD 内的两个应用程序 运行 尝试通信时,它们需要具有一组权限才能调用某些操作。这些操作通过 RBAC(基于角色和基于集群)允许和控制,允许两个不同的服务 运行 相互通信。