Skip to content

Commit

Permalink
DEV-600 Updated nodegroup configuration to specify MIN/MAX no. of nod…
Browse files Browse the repository at this point in the history
…es in scale policy
  • Loading branch information
ravisrivastva-qasource committed Apr 17, 2024
1 parent fa2a878 commit c0d21ef
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 93 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,23 @@ module "red5pro" {
node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group
node_group_name = "terraform-node-group" # Node group name
# Origin node configuration
node_group_origins = 1 # Number of Origins
node_group_origins_min = 1 # Number of minimum Origins
node_group_origins_max = 20 # Number of maximum Origins
node_group_origins_instance_type = "t3.medium" # Instance type for Origins
node_group_origins_capacity = 20 # Connections capacity for Origins
# Edge node configuration
node_group_edges = 1 # Number of Edges
node_group_edges_min = 1 # Number of minimum Edges
node_group_edges_max = 40 # Number of maximum Edges
node_group_edges_instance_type = "t3.medium" # Instance type for Edges
node_group_edges_capacity = 200 # Connections capacity for Edges
# Transcoder node configuration
node_group_transcoders = 0 # Number of Transcoders
node_group_transcoders_min = 0 # Number of minimum Transcoders
node_group_transcoders_max = 20 # Number of maximum Transcoders
node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders
node_group_transcoders_capacity = 20 # Connections capacity for Transcoders
# Relay node configuration
node_group_relays = 0 # Number of Relays
node_group_relays_min = 0 # Number of minimum Relays
node_group_relays_max = 20 # Number of maximum Relays
node_group_relays_instance_type = "t3.medium" # Instance type for Relays
node_group_relays_capacity = 20 # Connections capacity for Relays
Expand Down Expand Up @@ -369,19 +373,23 @@ module "red5pro" {
node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group
node_group_name = "terraform-node-group" # Node group name
# Origin node configuration
node_group_origins = 1 # Number of Origins
node_group_origins_min = 1 # Number of minimum Origins
node_group_origins_max = 20 # Number of maximum Origins
node_group_origins_instance_type = "t3.medium" # Instance type for Origins
node_group_origins_capacity = 20 # Connections capacity for Origins
# Edge node configuration
node_group_edges = 1 # Number of Edges
node_group_edges_min = 1 # Number of minimum Edges
node_group_edges_max = 40 # Number of maximum Edges
node_group_edges_instance_type = "t3.medium" # Instance type for Edges
node_group_edges_capacity = 200 # Connections capacity for Edges
# Transcoder node configuration
node_group_transcoders = 0 # Number of Transcoders
node_group_transcoders_min = 0 # Number of minimum Transcoders
node_group_transcoders_max = 20 # Number of maximum Transcoders
node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders
node_group_transcoders_capacity = 20 # Connections capacity for Transcoders
# Relay node configuration
node_group_relays = 0 # Number of Relays
node_group_relays_min = 0 # Number of minimum Relays
node_group_relays_max = 20 # Number of maximum Relays
node_group_relays_instance_type = "t3.medium" # Instance type for Relays
node_group_relays_capacity = 20 # Connections capacity for Relays
Expand Down
12 changes: 8 additions & 4 deletions examples/autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,23 @@ module "red5pro" {
node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group
node_group_name = "terraform-node-group" # Node group name
# Origin node configuration
node_group_origins = 1 # Number of Origins
node_group_origins_min = 1 # Number of minimum Origins
node_group_origins_max = 20 # Number of maximum Origins
node_group_origins_instance_type = "t3.medium" # Instance type for Origins
node_group_origins_capacity = 20 # Connections capacity for Origins
# Edge node configuration
node_group_edges = 1 # Number of Edges
node_group_edges_min = 1 # Number of minimum Edges
node_group_edges_max = 40 # Number of maximum Edges
node_group_edges_instance_type = "t3.medium" # Instance type for Edges
node_group_edges_capacity = 200 # Connections capacity for Edges
# Transcoder node configuration
node_group_transcoders = 0 # Number of Transcoders
node_group_transcoders_min = 0 # Number of minimum Transcoders
node_group_transcoders_max = 20 # Number of maximum Transcoders
node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders
node_group_transcoders_capacity = 20 # Connections capacity for Transcoders
# Relay node configuration
node_group_relays = 0 # Number of Relays
node_group_relays_min = 0 # Number of minimum Relays
node_group_relays_max = 20 # Number of maximum Relays
node_group_relays_instance_type = "t3.medium" # Instance type for Relays
node_group_relays_capacity = 20 # Connections capacity for Relays

Expand Down
12 changes: 8 additions & 4 deletions examples/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,23 @@ module "red5pro" {
node_group_create = true # Linux or Mac OS only. true - create new Node group, false - not create new Node group
node_group_name = "terraform-node-group" # Node group name
# Origin node configuration
node_group_origins = 1 # Number of Origins
node_group_origins_min = 1 # Number of minimum Origins
node_group_origins_max = 20 # Number of maximum Origins
node_group_origins_instance_type = "t3.medium" # Instance type for Origins
node_group_origins_capacity = 20 # Connections capacity for Origins
# Edge node configuration
node_group_edges = 1 # Number of Edges
node_group_edges_min = 1 # Number of minimum Edges
node_group_edges_max = 40 # Number of maximum Edges
node_group_edges_instance_type = "t3.medium" # Instance type for Edges
node_group_edges_capacity = 200 # Connections capacity for Edges
# Transcoder node configuration
node_group_transcoders = 0 # Number of Transcoders
node_group_transcoders_min = 0 # Number of minimum Transcoders
node_group_transcoders_max = 20 # Number of maximum Transcoders
node_group_transcoders_instance_type = "t3.medium" # Instance type for Transcoders
node_group_transcoders_capacity = 20 # Connections capacity for Transcoders
# Relay node configuration
node_group_relays = 0 # Number of Relays
node_group_relays_min = 0 # Number of minimum Relays
node_group_relays_max = 20 # Number of maximum Relays
node_group_relays_instance_type = "t3.medium" # Instance type for Relays
node_group_relays_capacity = 20 # Connections capacity for Relays

Expand Down
46 changes: 25 additions & 21 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1201,27 +1201,31 @@ resource "null_resource" "node_group" {
when = create
command = "bash ${abspath(path.module)}/red5pro-installer/r5p_create_node_group.sh"
environment = {
NAME = "${var.name}"
SM_IP = "${local.stream_manager_ip}"
SM_API_KEY = "${var.stream_manager_api_key}"
NODE_GROUP_REGION ="${var.aws_region}"
NODE_GROUP_NAME = "${var.node_group_name}"
ORIGINS = "${var.node_group_origins}"
EDGES = "${var.node_group_edges}"
TRANSCODERS = "${var.node_group_transcoders}"
RELAYS = "${var.node_group_relays}"
ORIGIN_INSTANCE_TYPE = "${var.node_group_origins_instance_type}"
EDGE_INSTANCE_TYPE = "${var.node_group_edges_instance_type}"
TRANSCODER_INSTANCE_TYPE = "${var.node_group_transcoders_instance_type}"
RELAY_INSTANCE_TYPE = "${var.node_group_relays_instance_type}"
ORIGIN_CAPACITY = "${var.node_group_origins_capacity}"
EDGE_CAPACITY = "${var.node_group_edges_capacity}"
TRANSCODER_CAPACITY = "${var.node_group_transcoders_capacity}"
RELAY_CAPACITY = "${var.node_group_relays_capacity}"
ORIGIN_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_origin_image[0].name, null)}"
EDGE_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_edge_image[0].name, null)}"
TRANSCODER_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_transcoder_image[0].name, null)}"
RELAY_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_relay_image[0].name, null)}"
NAME = "${var.name}"
SM_IP = "${local.stream_manager_ip}"
SM_API_KEY = "${var.stream_manager_api_key}"
NODE_GROUP_REGION ="${var.aws_region}"
NODE_GROUP_NAME = "${var.node_group_name}"
ORIGINS_MIN = "${var.node_group_origins_min}"
EDGES_MIN = "${var.node_group_edges_min}"
TRANSCODERS_MIN = "${var.node_group_transcoders_min}"
RELAYS_MIN = "${var.node_group_relays_min}"
ORIGINS_MAX = "${var.node_group_origins_max}"
EDGES_MAX = "${var.node_group_edges_max}"
TRANSCODERS_MAX = "${var.node_group_transcoders_max}"
RELAYS_MAX = "${var.node_group_relays_max}"
ORIGIN_INSTANCE_TYPE = "${var.node_group_origins_instance_type}"
EDGE_INSTANCE_TYPE = "${var.node_group_edges_instance_type}"
TRANSCODER_INSTANCE_TYPE = "${var.node_group_transcoders_instance_type}"
RELAY_INSTANCE_TYPE = "${var.node_group_relays_instance_type}"
ORIGIN_CAPACITY = "${var.node_group_origins_capacity}"
EDGE_CAPACITY = "${var.node_group_edges_capacity}"
TRANSCODER_CAPACITY = "${var.node_group_transcoders_capacity}"
RELAY_CAPACITY = "${var.node_group_relays_capacity}"
ORIGIN_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_origin_image[0].name, null)}"
EDGE_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_edge_image[0].name, null)}"
TRANSCODER_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_transcoder_image[0].name, null)}"
RELAY_IMAGE_NAME = "${try(aws_ami_from_instance.red5pro_node_relay_image[0].name, null)}"
}
}
provisioner "local-exec" {
Expand Down
Loading

0 comments on commit c0d21ef

Please sign in to comment.