Make proxy protocol in upcloud LB configurable (#10971)

pull/11028/head
David 2024-03-23 00:08:59 +01:00 committed by GitHub
parent e7d29715b4
commit 01c86af77f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 5 deletions

View File

@ -116,8 +116,9 @@ k8s_allowed_remote_ips = [
master_allowed_ports = [] master_allowed_ports = []
worker_allowed_ports = [] worker_allowed_ports = []
loadbalancer_enabled = false loadbalancer_enabled = false
loadbalancer_plan = "development" loadbalancer_plan = "development"
loadbalancer_proxy_protocol = false
loadbalancers = { loadbalancers = {
# "http" : { # "http" : {
# "port" : 80, # "port" : 80,

View File

@ -31,9 +31,10 @@ module "kubernetes" {
master_allowed_ports = var.master_allowed_ports master_allowed_ports = var.master_allowed_ports
worker_allowed_ports = var.worker_allowed_ports worker_allowed_ports = var.worker_allowed_ports
loadbalancer_enabled = var.loadbalancer_enabled loadbalancer_enabled = var.loadbalancer_enabled
loadbalancer_plan = var.loadbalancer_plan loadbalancer_plan = var.loadbalancer_plan
loadbalancers = var.loadbalancers loadbalancer_outbound_proxy_protocol = var.loadbalancer_proxy_protocol ? "v2" : ""
loadbalancers = var.loadbalancers
server_groups = var.server_groups server_groups = var.server_groups
} }

View File

@ -521,6 +521,9 @@ resource "upcloud_loadbalancer_backend" "lb_backend" {
loadbalancer = upcloud_loadbalancer.lb[0].id loadbalancer = upcloud_loadbalancer.lb[0].id
name = "lb-backend-${each.key}" name = "lb-backend-${each.key}"
properties {
outbound_proxy_protocol = var.loadbalancer_outbound_proxy_protocol
}
} }
resource "upcloud_loadbalancer_frontend" "lb_frontend" { resource "upcloud_loadbalancer_frontend" "lb_frontend" {

View File

@ -85,6 +85,10 @@ variable "loadbalancer_plan" {
type = string type = string
} }
variable "loadbalancer_outbound_proxy_protocol" {
type = string
}
variable "loadbalancers" { variable "loadbalancers" {
description = "Load balancers" description = "Load balancers"

View File

@ -121,6 +121,11 @@ variable "loadbalancer_plan" {
default = "development" default = "development"
} }
variable "loadbalancer_proxy_protocol" {
type = bool
default = false
}
variable "loadbalancers" { variable "loadbalancers" {
description = "Load balancers" description = "Load balancers"