了解 CloudFoundry 中应用程序实例的容器到容器安全性

Understanding container-to-container security for application instances in CloudFoundry

我参考了 https://ict.swisscom.ch/2018/05/container-networking-with-cloud-foundry/ and https://docs.cloudfoundry.org/concepts/understand-cf-networking.html

上有关容器到容器安全性的文章

这有助于定义直接的应用程序间连接。我仍然试图找出应用程序 实例 之间的连接是如何工作的,即当将应用程序扩展到 2 个实例时,这 2 个实例如何通过网络相互查看?我试图解决这个问题很长时间,因为这对于基于集群的交互非常重要,例如 Hazelcast,使用广播机制来识别集群成员。

是否在某处记录了(应用程序实例内连接)?

Is that (intra-application instance connectivity) documented somewhere?

这与应用程序之间的通信相同。一切都只是一个连接到容器到容器网络的实例。 AppA & AppB,或 AppA 实例 #1 和 AppA 实例 #2。它们都在容器到容器网络上。

All Diego cells in your Cloud Foundry deployment share this overlay network. By default, each cell is allocated a /24 range that supports 254 containers per cell, one container for each of the usable IP addresses, .1 through .254.

发件人:https://docs.cloudfoundry.org/concepts/understand-cf-networking.html#overlay-network

请记住,默认情况下会阻止所有流量,因此您需要添加网络策略以允许通过 C2C 网络的流量。对于两个应用程序之间的对话,cf add-network-policy 语法很有意义。您有源应用程序和目标应用程序。对于同一应用程序中的应用程序容器,该命令有点混乱,因为只有一个应用程序,没有源和目标。也就是说,如果您使源和目标相同,它应该可以正常工作。

例如:cf add-network-policy my-cluster-app --destination-app my-cluster-app --protocol tcp --port 9990-10000

希望对您有所帮助!