Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blewis/autoscaling #168

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/schemas/containers/config/Config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ properties:
$ref: ContainerNetwork.yml
deploy:
$ref: ContainerDeploy.yml
scale:
$ref: ContainerScale.yml
runtime:
$ref: ContainerRuntime.yml
resources:
Expand Down
45 changes: 45 additions & 0 deletions components/schemas/containers/config/ContainerScale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
title: ContainerScale
type: object
description: Network configuration for a container.
required:
- autoscale_group
- instances
- window
- thresholds
properties:
autoscale_group:
type: string
description: The autoscaling group describes which servers should be deployed
instances:
type: object
description: Describes how many instances should be running
required:
- min
- delta
- max
- max_server
- min_ttl
properties:
min:
type: integer
description: Minimum additional instances the autoscaler will run at any time
delta:
type: integer
description: Number of additional instances the autoscaler will add/subtract per scaling event
max:
type: integer
description: Maximum additional instances the autoscaler will run at any time
max_server:
type: integer
description: Minimum number of instances per server
min_ttl:
$ref: ../../Duration.yml
description: Minimum amount of time an instance will live
window:
description: Duration in which the autoscaler will watch for changes
$ref: ../../Duration.yml
thresholds:
description: An array of rules that dictate when a scaling event will be triggered
type: array
items:
$ref: ./scale/ScaleThresholdMetric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: ScaleThresholdMetric
type: object
description: Discriminated union describing the different types of scaling threshold and their respective details
discriminator:
propertyName: type
mapping:
ram: ./ScaleThresholdMetricRam.yml
cpu: ./ScaleThresholdMetricCpu.yml
network-connections: ./ScaleThresholdMetricNetworkConnections.yml
network-requests: ./ScaleThresholdMetricNetworkRequests.yml
network-throughput: ./ScaleThresholdMetricNetworkThroughput.yml
oneOf:
- $ref: ./ScaleThresholdMetricRam.yml
- $ref: ./ScaleThresholdMetricCpu.yml
- $ref: ./ScaleThresholdMetricNetworkConnections.yml
- $ref: ./ScaleThresholdMetricNetworkRequests.yml
- $ref: ./ScaleThresholdMetricNetworkThroughput.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: ScaleThresholdMetricCpu
type: object
description: Describes the CPU threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- cpu
details:
type: object
required:
- utilization
properties:
utilization:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: ScaleThresholdMetricNetworkConnections
type: object
description: Describes the network connections threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- network-connections
details:
type: object
required:
- connections_total
properties:
connections_total:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: ScaleThresholdMetricNetworkRequests
type: object
description: Describes the network requests threshold at which scaling will occur

required:
- type
- details
properties:
type:
type: string
enum:
- network-requests
details:
type: object
required:
- requests_total
properties:
requests_total:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
title: ScaleThresholdMetricNetworkThroughput
type: object
description: Describes the network throughput threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- network-throughput
details:
type: object
required:
- private
- bandwidth
properties:
private:
type: boolean
bandwidth:
type: string
description: The limit (maximum) amount of throughput each instance of the given container can use before triggering a scaling event.
example: "1G, 2M"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
title: ScaleThresholdMetricRam
type: object
description: Describes the RAM threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- ram
details:
type: object
required:
- used
properties:
used:
type: string
description: The limit (maximum) amount of RAM each instance of the given container can use before triggering a scaling event.
example: "1G, 2M"
63 changes: 39 additions & 24 deletions components/schemas/stacks/spec/StackContainerConfigScaling.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
title: StackContainerConfigScaling.yml
type: object
description: Network configuration for a container.
required:
- autoscale_group
- instances
- window
- thresholds
properties:
auto:
autoscale_group:
type: string
description: The autoscaling group describes which servers should be deployed
instances:
type: object
description: Describes how many instances should be running
required:
- instances
- min
- delta
- max
- max_server
- min_ttl
properties:
instances:
type: object
required:
- min
- max
properties:
min:
type: integer
max:
type: integer
rules:
type: object
required:
- metric
- threshold
properties:
metric:
type: string
enum:
- ram
threshold:
type: string
min:
type: integer
description: Minimum additional instances the autoscaler will run at any time
delta:
type: integer
description: Number of additional instances the autoscaler will add/subtract per scaling event
max:
type: integer
description: Maximum additional instances the autoscaler will run at any time
max_server:
type: integer
description: Minimum number of instances per server
min_ttl:
$ref: ../../Duration.yml
description: Minimum amount of time an instance will live
window:
description: Duration in which the autoscaler will watch for changes
$ref: ../../Duration.yml
thresholds:
description: An array of rules that dictate when a scaling event will be triggered
type: array
items:
$ref: ./scale/StackContainerScaleThreshold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: StackContainerScaleThreshold
type: object
description: Discriminated union describing the different types of scaling threshold and their respective details
discriminator:
propertyName: type
mapping:
ram: ./StackContainerScaleThresholdRam.yml
cpu: ./StackContainerScaleThresholdCpu.yml
network-connections: ./StackContainerScaleThresholdNetworkConnections.yml
network-requests: ./StackContainerScaleThresholdNetworkRequests.yml
network-throughput: ./StackContainerScaleThresholdNetworkThroughput.yml
oneOf:
- $ref: ./StackContainerScaleThresholdRam.yml
- $ref: ./StackContainerScaleThresholdCpu.yml
- $ref: ./StackContainerScaleThresholdNetworkConnections.yml
- $ref: ./StackContainerScaleThresholdNetworkRequests.yml
- $ref: ./StackContainerScaleThresholdNetworkThroughput.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: StackContainerScaleThresholdCpu
type: object
description: Describes the CPU threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- cpu
details:
type: object
required:
- utilization
properties:
utilization:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: StackContainerScaleThresholdNetworkConnections
type: object
description: Describes the network connections threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- network-connections
details:
type: object
required:
- connections_total
properties:
connections_total:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: StackContainerScaleThresholdNetworkRequests
type: object
description: Describes the network requests threshold at which scaling will occur

required:
- type
- details
properties:
type:
type: string
enum:
- network-requests
details:
type: object
required:
- requests_total
properties:
requests_total:
type: integer
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
title: StackContainerScaleThresholdNetworkThroughput
type: object
description: Describes the network throughput threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- network-throughput
details:
type: object
required:
- private
- bandwidth
properties:
private:
type: boolean
bandwidth:
type: string
description: The limit (maximum) amount of throughput each instance of the given container can use before triggering a scaling event.
example: "1G, 2M"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
title: StackContainerScaleThresholdRam
type: object
description: Describes the RAM threshold at which scaling will occur
required:
- type
- details
properties:
type:
type: string
enum:
- ram
details:
type: object
required:
- used
properties:
used:
type: string
description: The limit (maximum) amount of RAM each instance of the given container can use before triggering a scaling event.
example: "1G, 2M"