From 6f57e0880d498ebfc08d74205fb6796acde84a2c Mon Sep 17 00:00:00 2001 From: lukeify <5379845+lukeify@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:13:10 +1200 Subject: [PATCH 1/5] chore: initial commit --- Fly.io.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Fly.io.md diff --git a/Fly.io.md b/Fly.io.md new file mode 100644 index 0000000..63ea429 --- /dev/null +++ b/Fly.io.md @@ -0,0 +1,7 @@ +# Fly.io + +## Pricing + +* "RootFS" $0.15/GB/month +* Shared 1x CPU machines +* $5 free allowance/month From 977b69e9a147df550f3d57a960939c751a9d8905 Mon Sep 17 00:00:00 2001 From: lukeify <5379845+lukeify@users.noreply.github.com> Date: Thu, 11 Jul 2024 22:06:24 +1200 Subject: [PATCH 2/5] chore: expand on pricing --- Fly.io.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Fly.io.md b/Fly.io.md index 63ea429..a00474c 100644 --- a/Fly.io.md +++ b/Fly.io.md @@ -1,7 +1,20 @@ # Fly.io -## Pricing +No IaC story at the moment. Had a previous terraform provider but was discontinued. Manage infrastructure through the web GUI or `flyctl` CLI. -* "RootFS" $0.15/GB/month -* Shared 1x CPU machines -* $5 free allowance/month +## [Pricing][1] + +There is no "free allowance" on new fly.io plans (referred to as "Pay As You Go"), instead, you pay for compute resources as you use them. + +For the majority of apps, fly machines in the `shared-cpu-1x` category will be sufficient. +As an example, for a near-stock Rails app that was deployed to the Sydney region, the resources created were: + +* A `shared-cpu-1x-1024` maachine to host the Rails app proper (incurring a US$7.23/mo bill). +* An additional `shared-cpu-1x-256` to support the corresponding database (US$2.47/mo). +* A volume to back the data stored in this database (initially a 1GB volume, billed at US$0.15/GB/mo). + +Apps that are shutdown but persist on Fly.io accumulate a RootFS storage fee of $0.15/GB/month—this covers the cost of the file system, and is based on your OCI image generated from your app. +[This change took effect from April 2024][2]. + +[1]: https://fly.io/docs/about/pricing/ +[2]: https://community.fly.io/t/we-are-going-to-start-collecting-charges-for-stopped-machines-rootfs-starting-april-25th/17825 From d8a745ebf87aca6fb2a2739f8ec2b89b8e5b2d47 Mon Sep 17 00:00:00 2001 From: lukeify <5379845+lukeify@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:17:38 +1200 Subject: [PATCH 3/5] chore: scaffold additional sections --- Fly.io.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Fly.io.md b/Fly.io.md index a00474c..f6fa6a5 100644 --- a/Fly.io.md +++ b/Fly.io.md @@ -5,6 +5,7 @@ No IaC story at the moment. Had a previous terraform provider but was discontinu ## [Pricing][1] There is no "free allowance" on new fly.io plans (referred to as "Pay As You Go"), instead, you pay for compute resources as you use them. +However bills that accumulate a usage of less than US$5.00/mo are currently waived. For the majority of apps, fly machines in the `shared-cpu-1x` category will be sufficient. As an example, for a near-stock Rails app that was deployed to the Sydney region, the resources created were: @@ -16,5 +17,37 @@ As an example, for a near-stock Rails app that was deployed to the Sydney region Apps that are shutdown but persist on Fly.io accumulate a RootFS storage fee of $0.15/GB/month—this covers the cost of the file system, and is based on your OCI image generated from your app. [This change took effect from April 2024][2]. +## Deployment + +An example deployment flow using `fly.io` for a Ruby on Rails app. + +### Integrating secrets + +`flyctl launch --no-deploy` + +Add TAILSCALE_AUTHKEY secret +Add RAILS_SECRET_KEY_BASE secret + +`flyctl deploy` + +https://community.fly.io/t/setting-secrets-before-the-first-deployment-does-nothing/5589/7 + + +### Runtime secrets + + +### Networking + +Apps created with Fly.io are immediately assigned an IP address and provided with a `.fly.dev` domain name. +The public-facing IP address can be removed via either `flyctl` or through the GUI. + +TODO: + +https://fly.io/docs/blueprints/private-applications-flycast/ +https://fly.io/docs/blueprints/connect-private-network-wireguard/ +https://tailscale.com/kb/1132/flydotio +https://community.fly.io/t/accessing-an-external-non-public-resource-from-your-fly-io-app/10180 +https://community.fly.io/t/connecting-your-fly-apps-to-your-tailscale-tailnet/17828 + [1]: https://fly.io/docs/about/pricing/ [2]: https://community.fly.io/t/we-are-going-to-start-collecting-charges-for-stopped-machines-rootfs-starting-april-25th/17825 From daa048a4e0dd121c213fefa230fba19ecd6c7d13 Mon Sep 17 00:00:00 2001 From: lukeify <5379845+lukeify@users.noreply.github.com> Date: Sat, 21 Sep 2024 22:14:56 +1200 Subject: [PATCH 4/5] chore: reorder deployment story --- Fly.io.md | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/Fly.io.md b/Fly.io.md index f6fa6a5..9ac7e43 100644 --- a/Fly.io.md +++ b/Fly.io.md @@ -21,21 +21,57 @@ Apps that are shutdown but persist on Fly.io accumulate a RootFS storage fee of An example deployment flow using `fly.io` for a Ruby on Rails app. +### Initialization + +Although fly.io can create deploy an application from a repository with a single command (`flyctl launch`), this reduces the amount of customisation available. +Additionally, often secrets that are required for the Rails app to boot will not be present in the initial Docker machine image that fly.io will create and changes will be needed. +Instead, an application can be registered using: + +```bash +fly apps create APP_NAME +``` + +This will create an instance of an application with no machines attached. + ### Integrating secrets -`flyctl launch --no-deploy` +Secrets can be added to an application without redeploying using the staging command: + +```bash +fly secrets set SECREY_KEY=secret_value --stage +``` Add TAILSCALE_AUTHKEY secret Add RAILS_SECRET_KEY_BASE secret -`flyctl deploy` +### Attaching services + + + +### Build configuration + +### Launching + + +`fly deploy` will automatically provision 2 machines. +Specifying false high availability will reduce this to one—this is beneficial for non-production environments. +There does not appear to be a `fly.toml` configuration for this. + +```bash +flyctl deploy --ha=false +``` + + +```bash +flyctl launch --no-deploy +``` + https://community.fly.io/t/setting-secrets-before-the-first-deployment-does-nothing/5589/7 ### Runtime secrets - ### Networking Apps created with Fly.io are immediately assigned an IP address and provided with a `.fly.dev` domain name. From cc730fa8a077eb97784a86471198d8864837982c Mon Sep 17 00:00:00 2001 From: lukeify <5379845+lukeify@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:33:47 +1300 Subject: [PATCH 5/5] docs: additional links for headscale --- Fly.io.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Fly.io.md b/Fly.io.md index 9ac7e43..c65f81f 100644 --- a/Fly.io.md +++ b/Fly.io.md @@ -84,6 +84,11 @@ https://fly.io/docs/blueprints/connect-private-network-wireguard/ https://tailscale.com/kb/1132/flydotio https://community.fly.io/t/accessing-an-external-non-public-resource-from-your-fly-io-app/10180 https://community.fly.io/t/connecting-your-fly-apps-to-your-tailscale-tailnet/17828 +https://thisisfranklin.com/2023/01/13/running-rails-on-flyio-with-tailscale.html +https://fly.io/docs/networking/flycast/ +https://fly.io/docs/blueprints/autostart-internal-apps/ +https://tailscale.com/kb/1153/enabling-https +https://tailscale.com/kb/1054/dns [1]: https://fly.io/docs/about/pricing/ [2]: https://community.fly.io/t/we-are-going-to-start-collecting-charges-for-stopped-machines-rootfs-starting-april-25th/17825