forked from superfly/fly-autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfly-autoscaler.yml
60 lines (52 loc) · 2.38 KB
/
fly-autoscaler.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# The name of the target app that you want to scale.
app-name: "TARGET_APP_NAME"
# A list of regions to create machines in. Regions are chosen via round robin
# so that machines are evenly distributed.
#
# If this is not specified, the autoscaler will choose a region based on the
# regions that the app is currently running in.
regions: ['iad', 'ord', 'sjc']
# This expression determines the number of machines to maintain in your app
# after each reconciliation. If the number of machines drops below this
# threshold then more will be created by cloning one of the existing machines.
# If the number of machines is above this threshold then some machines will be
# destroyed.
#
# There always needs to be at least one machine in your application so the
# autoscaler will never destroy your last machine, even if the threshold reaches
# zero.
#
# You can also define separate minimum & maximum thresholds using the
# "min_created_machine_count" & "max_created_machine_count" fields.
created-machine-count: "ceil(queue_depth / 10)"
# This expression determines the number of machines to maintain in a "started"
# state after each reconciliation. If the number of started machines is less
# existing machines will be started. If the number of started machines is more
# then running machines will be stopped.
#
# You can also define separate minimum & maximum thresholds using the
# "min_started_machine_count" & "max_started_machine_count" fields.
started-machine-count: "ceil(queue_depth / 10)"
# The frequency that the reconciliation loop will be run.
interval: "15s"
# A Fly.io auth token that has permission to start machines for the target app.
# This is typically set via the FAS_API_TOKEN environment variable.
api-token: "FlyV1 ..."
# If true, enables verbose debugging logging.
verbose: false
# Metric collectors fetch the current metrics when a reconciliation is performed.
#
# They store the current value locally with a given metric name so that the
# expression can be used to calculate the machine count.
metric-collectors:
- type: "prometheus"
metric-name: "queue_depth"
address: "https://api.fly.io/prometheus/MY_ORG"
query: "sum(queue_depth)"
token: "FlyV1 ..."
- type: "temporal"
metric-name: "workflow_count"
address: "localhost:7233"
cert-data: "-----BEGIN CERTIFICATE-----..."
key-data: "-----BEGIN EC PRIVATE KEY-----..."
query: 'WorkflowType="my_workflow_type"'