As we continue to roll out features to Fifo.Cloud this week we would like to show off Network VM State Scripts. When we started with the idea of fifo.cloud we wanted a solution where people could place native containers in multiple data centers. One of the complications of running containers in a public cloud environment is that the user often does not control the network, and many times network controls are in place to require the use of APIs in order to activate additional IP addresses and connections. In this post, we will show how a fifo.cloud user can Network VM State Scripts to make API calls and setup routing in a public cloud environment.
Throughout this post, we will use Packet as an example service provider, but the concepts should apply to other cloud providers as well.
Like other many cloud providers, Packet.net provides the ability to assign additional IP addresses via Elastic IPs. When Packet Elastic IPs are assigned to a host Packet directs all traffic for that IP to the network interface on that host. The trick to using this setup is that all traffic outgoing must be routed through the management IP address. Attached is a diagram showing the necessary layout.
When an elastic IP address is assigned to a host, traffic for that IP is passed to the primary interface. Routing inbound traffic from requires adding a route to the IP of the container to the bridge interface that the VM is connected to. Outbound traffic requires the default gateway of the VM being an IP of the bridge. The host must then have routing enabled so that traffic routed through the bridge IP is then routed out the default interface of the host.
All of this requires several steps, which would be rather manual. Luckily Fifo.Cloud has added network create and delete scripts. These scripts are run for each network interface that is created on a VM, allowing for any of this sort of routing additions or deletions. In a customer-owned network create and delete scripts could be used for setting up SDN routes, starting BGP announcements, or anything else you can imagine.
We have put together a how-to for using network create/delete scripts at https://docs.fifo.cloud/howtos/public-cloud-ip/ . While these directions are specific to Packet, the basics will apply to other providers.
Every new feature we roll out brings us closer to a production release of fifo.cloud, and we can’t wait to see what you will build with it!