mirror of
https://github.com/optim-enterprises-bv/terraform-talos.git
synced 2025-10-30 17:58:32 +00:00
Contolplane LB
This commit is contained in:
@@ -12,38 +12,46 @@ resource "scaleway_lb_ip" "lb" {
|
||||
|
||||
resource "scaleway_lb" "lb" {
|
||||
count = local.lb_enable ? 1 : 0
|
||||
name = "lb"
|
||||
name = "controlplane"
|
||||
ip_id = scaleway_lb_ip.lb[0].id
|
||||
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" {
|
||||
# count = local.lb_enable ? 1 : 0
|
||||
# lb_id = scaleway_lb.lb[0].id
|
||||
# name = "api"
|
||||
# forward_protocol = "tcp"
|
||||
# forward_port = "6443"
|
||||
# server_ips = scaleway_instance_server.controlplane[*].private_ip
|
||||
resource "scaleway_lb_backend" "api" {
|
||||
count = local.lb_enable ? 1 : 0
|
||||
lb_id = scaleway_lb.lb[0].id
|
||||
name = "api"
|
||||
forward_protocol = "tcp"
|
||||
forward_port = "6443"
|
||||
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" {
|
||||
# count = local.lb_enable ? 1 : 0
|
||||
# lb_id = scaleway_lb.lb[0].id
|
||||
# backend_id = scaleway_lb_backend.api[0].id
|
||||
# name = "api"
|
||||
# inbound_port = "6443"
|
||||
resource "scaleway_lb_frontend" "api" {
|
||||
count = local.lb_enable ? 1 : 0
|
||||
lb_id = scaleway_lb.lb[0].id
|
||||
backend_id = scaleway_lb_backend.api[0].id
|
||||
name = "api"
|
||||
inbound_port = "6443"
|
||||
|
||||
# acl {
|
||||
# name = "Allow whitlist IPs"
|
||||
# action {
|
||||
# type = "allow"
|
||||
# }
|
||||
# match {
|
||||
# ip_subnet = var.whitelist_admins
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
acl {
|
||||
name = "Allow whitlist IPs"
|
||||
action {
|
||||
type = "allow"
|
||||
}
|
||||
match {
|
||||
ip_subnet = var.whitelist_admins
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user