mirror of
				https://github.com/optim-enterprises-bv/terraform-talos.git
				synced 2025-11-03 19:57:46 +00:00 
			
		
		
		
	Contolplane LB
This commit is contained in:
		@@ -12,38 +12,46 @@ resource "scaleway_lb_ip" "lb" {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
resource "scaleway_lb" "lb" {
 | 
					resource "scaleway_lb" "lb" {
 | 
				
			||||||
  count = local.lb_enable ? 1 : 0
 | 
					  count = local.lb_enable ? 1 : 0
 | 
				
			||||||
  name  = "lb"
 | 
					  name  = "controlplane"
 | 
				
			||||||
  ip_id = scaleway_lb_ip.lb[0].id
 | 
					  ip_id = scaleway_lb_ip.lb[0].id
 | 
				
			||||||
  type  = lookup(var.controlplane, "type_lb", "LB-S")
 | 
					  type  = lookup(var.controlplane, "type_lb", "LB-S")
 | 
				
			||||||
 | 
					 | 
				
			||||||
  tags  = concat(var.tags, ["infra"])
 | 
					  tags  = concat(var.tags, ["infra"])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private_network {
 | 
				
			||||||
 | 
					    private_network_id = scaleway_vpc_private_network.main.id
 | 
				
			||||||
 | 
					    static_config      = [cidrhost(local.main_subnet, 3), cidrhost(local.main_subnet, 4)]
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# resource "scaleway_lb_backend" "api" {
 | 
					resource "scaleway_lb_backend" "api" {
 | 
				
			||||||
#   count            = local.lb_enable ? 1 : 0
 | 
					  count            = local.lb_enable ? 1 : 0
 | 
				
			||||||
#   lb_id            = scaleway_lb.lb[0].id
 | 
					  lb_id            = scaleway_lb.lb[0].id
 | 
				
			||||||
#   name             = "api"
 | 
					  name             = "api"
 | 
				
			||||||
#   forward_protocol = "tcp"
 | 
					  forward_protocol = "tcp"
 | 
				
			||||||
#   forward_port     = "6443"
 | 
					  forward_port     = "6443"
 | 
				
			||||||
#   server_ips       = scaleway_instance_server.controlplane[*].private_ip
 | 
					  server_ips       = scaleway_instance_server.controlplane[*].private_ip
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#   health_check_tcp {}
 | 
					  health_check_timeout = "5s"
 | 
				
			||||||
# }
 | 
					  health_check_delay   = "30s"
 | 
				
			||||||
 | 
					  health_check_https {
 | 
				
			||||||
 | 
					    uri = "/readyz"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# resource "scaleway_lb_frontend" "api" {
 | 
					resource "scaleway_lb_frontend" "api" {
 | 
				
			||||||
#   count        = local.lb_enable ? 1 : 0
 | 
					  count        = local.lb_enable ? 1 : 0
 | 
				
			||||||
#   lb_id        = scaleway_lb.lb[0].id
 | 
					  lb_id        = scaleway_lb.lb[0].id
 | 
				
			||||||
#   backend_id   = scaleway_lb_backend.api[0].id
 | 
					  backend_id   = scaleway_lb_backend.api[0].id
 | 
				
			||||||
#   name         = "api"
 | 
					  name         = "api"
 | 
				
			||||||
#   inbound_port = "6443"
 | 
					  inbound_port = "6443"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#   acl {
 | 
					  acl {
 | 
				
			||||||
#     name = "Allow whitlist IPs"
 | 
					    name = "Allow whitlist IPs"
 | 
				
			||||||
#     action {
 | 
					    action {
 | 
				
			||||||
#       type = "allow"
 | 
					      type = "allow"
 | 
				
			||||||
#     }
 | 
					    }
 | 
				
			||||||
#     match {
 | 
					    match {
 | 
				
			||||||
#       ip_subnet = var.whitelist_admins
 | 
					      ip_subnet = var.whitelist_admins
 | 
				
			||||||
#     }
 | 
					    }
 | 
				
			||||||
#   }
 | 
					  }
 | 
				
			||||||
# }
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user