Inter-FaaS platform networking
To make all functions of different platforms able to talk together, we need to set up a proper container network. The demo project discussed in this chapter is not a simple FaaS example. It is a complex scenario where functions are allowed to call other functions on the different FaaS platforms.
Normally, on some serverless platforms such as Lambda, we may sometimes assume that all functions run on the flat network of the provider. In contrast, when we run functions on our own platforms, we could segment the networks ourselves and function networking will become a challenge. However, networking will be relatively simple because the networking model in Docker and Swarm is the flat network.
How can we achieve this? By the following:
- We create an attachable Swarm-scoped network
- We start a FaaS framework and make its gateway attach to that network
- We also need to tell the framework that it must attach that network to every container it created
In OpenFaas, it allows...