12-factor app guidelines. There are two ways of deploying an application after declaring it in Flynn.
After cloning the repository https://github.com/ThibautGery/todomvc-mongodb, you can configure your application using the CLI:
git push flynn
When using git, the code is pushed to a remote git repository. The buildpack will detect the application’s language and download its dependencies before running the server using the Procfile.
You can also use the GUI using the Github integration to deploy clicking on buttons.
The repository must contain a Dockerfile in order to build the Docker image
docker build . -t my_image flynn -a my_app docker push my_image Flynn scale app=1
Using Docker, the image is pushed to a remote Docker registry. Then, the image will be run as a container after you configure the scale option. But first you need to configure Docker on your CLI:
Flynn offers little or no configuration possibilities on the application. Rancher, for example, offers some kind of configuration with a config file (similar to docker-compose). Flynn doesn't, but it packages four ready-to-use databases: MySQL, PostgreSQL, MongoDb (not sure it qualifies as a "Database"...) and Redis. But there are some restrictions:
Flynn’s databases are currently designed with staging, testing, development, and small-scale production workloads in mind. They are not currently suitable for storing large amounts of data.
From: flynn.io/docs/databases
The developers don't give any information about their understanding of "small-scale workloads", thus you should run load tests to verify the stability of the platform in your context.
There are four tools to use the Flynn platform: the developers will be using the GUI, the CLI, the API. The Ops have their own CLI to perform tasks on the cluster.
The developers can create the application, scale it, and remove it. They can manage their databases (MySQL, PostgreSQL, Redis, Mongodb), their HTML routes, their SSL certificates, their jobs and environment variables. Everything can be done using the GUI (great when starting) or using the CLI or the API (great for automation).
The Administrators can manage the cluster and the nodes (promoting or demoting them…). For example, they can list the nodes:
$ flynn-host list ID ADDR RAFT STATUS ip1002237 10.0.2.237:1113 peer ip1001170 10.0.1.170:1113 peer (leader) ip1006123 10.0.6.123:1113 peer
The best way to check the availability of a system is to run a benchmark.
The setup follows this configuration:
There were 8 users that had the following error:
j_ConnectException: Connection refused: todo-docker.vgry.flynnhub.com/52.62.245.207:80_
The DNS on Route53 records uses health checks and as soon the error was detected the DNS was changed. By the time the DNS was propagated, the faulty server was not accessible to the public.
The test shows that the current setup provides High Availability (HA) but there is a delay since it relies on DNS propagation. Depending on the use case, it might be sufficient. If you need a more aggressive HA, you can use a system in front to do it, like AWS Elastic Load Balancer or HAproxy.
A few notes:
The platform is built in Go and has several components and everything is detailed in their documentation:
The missing features are:
Flynn is a promising platform because of its ease of use however it is still a young framework and it is lacking some key features needed for enterprise deployment.
Flynn is not the silver bullet, here are some good reasons not to use it:
However, in the meantime, if you need to deploy several simple applications like an MVP to test ideas, the platform will help you to reduce your time to market.