Skip to content

Commit

Permalink
deploy balancer to prod and enable balancing on monolith (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 authored Mar 20, 2024
1 parent 9446cd4 commit e0d679d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

deploy-fly-prod:
deploy-fly-prod-monolith:
runs-on: ubuntu-latest
name: Deploy Monolith on fly.io (prod)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand All @@ -191,3 +191,15 @@ jobs:
- run: flyctl deploy --config deploy/fly.prod.monolith.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

deploy-fly-prod-balancer:
runs-on: ubuntu-latest
name: Deploy Balancer on fly.io (prod)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test, lint, deploy-fly-prod-monolith]
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --config deploy/fly.prod.balancer.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
29 changes: 29 additions & 0 deletions deploy/fly.prod.balancer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
app = "ott-balancer-prod"
primary_region = "ewr"

[build]
dockerfile = "balancer.Dockerfile"

[build.args]
DEPLOY_TARGET = "ott-balancer-prod"

[deploy]
strategy = "canary"

[http_service]
internal_port = 8081
force_https = true
# auto_stop_machines = true
# auto_start_machines = true
min_machines_running = 1

[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "10s"
path = "/api/status"

[metrics]
port = 8081
path = "/api/status/metrics"
4 changes: 4 additions & 0 deletions deploy/ott-balancer-prod.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[discovery]
method = "fly"
fly_app = "ott-prod"
service_port = 3002
3 changes: 3 additions & 0 deletions deploy/ott-prod.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ level = "info"

[mail]
enabled = true

[balancing]
enabled = true

0 comments on commit e0d679d

Please sign in to comment.