forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 68
Host rpc node in ecs #391
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
Merged
Merged
Host rpc node in ecs #391
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
50f4b3e
chore: add rpc node into the devnet deployment pipeline
wjrjerome cdfa982
temporary mark travis build branch as awsv2 to test out the terraform…
wjrjerome fe6e761
fix small rpc node nlb subnet duplication
wjrjerome 38abff8
revert to restore the devnet
wjrjerome fcdb9db
move the rpc node to apse1 only
wjrjerome a73a32c
make sure the load balancer using target type of ip
wjrjerome 3e17c10
fix only rpc paramter needs nlb
fa97f94
feat: add rpc node into the fargate ecs
wjrjerome File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,4 +10,4 @@ eu_west_1_end=72 | |
|
|
||
| # Sydney | ||
| ap_southeast_2_start=73 | ||
| ap_southeast_2_end=110 | ||
| ap_southeast_2_end=108 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Allocate an Elastic IP for the NLB | ||
| resource "aws_eip" "nlb_eip" { | ||
| domain = "vpc" | ||
| } | ||
|
|
||
|
|
||
| # Create a Network Load Balancer | ||
| resource "aws_lb" "rpc_node_nlb" { | ||
| count = var.enableFixedIp ? 1 : 0 | ||
| name = "rpc-node-nlb" | ||
| load_balancer_type = "network" | ||
|
|
||
| enable_deletion_protection = false | ||
|
|
||
| subnet_mapping { | ||
| subnet_id = aws_subnet.devnet_subnet.id | ||
| allocation_id = aws_eip.nlb_eip.id | ||
| } | ||
| } | ||
|
|
||
| # Listener and Target Group for the rpc node container | ||
| resource "aws_lb_target_group" "rpc_node_tg_8545" { | ||
| count = var.enableFixedIp ? 1 : 0 | ||
| name = "rpc-node-tg" | ||
| port = 8545 | ||
| protocol = "TCP" | ||
| vpc_id = aws_vpc.devnet_vpc.id | ||
| target_type = "ip" | ||
| } | ||
|
|
||
| resource "aws_lb_listener" "rpc_node_listener_8545" { | ||
| count = var.enableFixedIp ? 1 : 0 | ||
| load_balancer_arn = aws_lb.rpc_node_nlb[0].arn | ||
| port = 8545 | ||
| protocol = "TCP" | ||
|
|
||
| default_action { | ||
| type = "forward" | ||
| target_group_arn = aws_lb_target_group.rpc_node_tg_8545[0].arn | ||
| } | ||
| } | ||
|
|
||
| resource "aws_ecs_service" "devnet_rpc_node_ecs_service" { | ||
| for_each = var.enableFixedIp ? var.devnetNodeKeys : {} | ||
| name = "ecs-service-${each.key}" | ||
| cluster = aws_ecs_cluster.devnet_ecs_cluster.id | ||
| task_definition = "${aws_ecs_task_definition.devnet_task_definition_group[each.key].family}:${max(aws_ecs_task_definition.devnet_task_definition_group[each.key].revision, data.aws_ecs_task_definition.devnet_ecs_task_definition[each.key].revision)}" | ||
| launch_type = "FARGATE" | ||
| scheduling_strategy = "REPLICA" | ||
| desired_count = 1 | ||
| force_new_deployment = true | ||
| deployment_minimum_healthy_percent = 0 | ||
| deployment_maximum_percent = 100 | ||
|
|
||
| network_configuration { | ||
| subnets = [aws_subnet.devnet_subnet.id] | ||
| assign_public_ip = true | ||
| security_groups = [ | ||
| aws_default_security_group.devnet_xdcnode_security_group.id | ||
| ] | ||
| } | ||
|
|
||
| deployment_circuit_breaker { | ||
| enable = true | ||
| rollback = false | ||
| } | ||
|
|
||
| load_balancer { | ||
| target_group_arn = aws_lb_target_group.rpc_node_tg_8545[0].arn | ||
| container_name = "tfXdcNode" | ||
| container_port = 8545 | ||
| } | ||
|
|
||
| depends_on = [ | ||
| aws_lb_listener.rpc_node_listener_8545 | ||
| ] | ||
|
|
||
| tags = { | ||
| Name = "TfDevnetRpcNodeEcsService-${each.key}" | ||
| } | ||
| } | ||
|
|
||
| # Target Group for port 30303 | ||
| resource "aws_lb_target_group" "rpc_node_tg_30303" { | ||
| count = var.enableFixedIp ? 1 : 0 | ||
| name = "rpc-node-tg-30303" | ||
| port = 30303 | ||
| protocol = "TCP" | ||
| vpc_id = aws_vpc.devnet_vpc.id | ||
| target_type = "ip" | ||
| } | ||
|
|
||
| # Listener for port 30303 | ||
| resource "aws_lb_listener" "rpc_node_listener_30303" { | ||
| count = var.enableFixedIp ? 1 : 0 | ||
| load_balancer_arn = aws_lb.rpc_node_nlb[0].arn | ||
| port = 30303 | ||
| protocol = "TCP" | ||
|
|
||
| default_action { | ||
| type = "forward" | ||
| target_group_arn = aws_lb_target_group.rpc_node_tg_30303[0].arn | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space