feat: attach lb to network
This commit is contained in:
@@ -12,6 +12,13 @@ resource "hcloud_network_subnet" "subnet" {
|
||||
ip_range = local.subnet-cidr
|
||||
}
|
||||
|
||||
// Attach the load balancer to the compute subnet.
|
||||
resource "hcloud_load_balancer_network" "attachment" {
|
||||
load_balancer_id = hcloud_load_balancer.lb.id
|
||||
subnet_id = hcloud_network_subnet.subnet.id
|
||||
ip = local.lb-private-ip
|
||||
}
|
||||
|
||||
// Provide internet to the private servers, by sending all internet traffic to
|
||||
// the NAT.
|
||||
resource "hcloud_network_route" "gateway" {
|
||||
|
||||
@@ -3,6 +3,7 @@ locals {
|
||||
subnet-cidr = "10.0.2.0/24"
|
||||
|
||||
nat-private-ip = "10.0.2.8"
|
||||
lb-private-ip = "10.0.2.128"
|
||||
servers = {
|
||||
control = "10.0.2.11"
|
||||
node-a = "10.0.2.9"
|
||||
|
||||
Reference in New Issue
Block a user