Skip to content

Commit

Permalink
Make proxy protocol in upcloud LB configurable (kubernetes-sigs#10971)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidumea authored and dibi-codes committed May 7, 2024
1 parent b01a6f7 commit 29fd3fc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
5 changes: 3 additions & 2 deletions contrib/terraform/upcloud/cluster-settings.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ k8s_allowed_remote_ips = [
master_allowed_ports = []
worker_allowed_ports = []

loadbalancer_enabled = false
loadbalancer_plan = "development"
loadbalancer_enabled = false
loadbalancer_plan = "development"
loadbalancer_proxy_protocol = false
loadbalancers = {
# "http" : {
# "port" : 80,
Expand Down
7 changes: 4 additions & 3 deletions contrib/terraform/upcloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ module "kubernetes" {
master_allowed_ports = var.master_allowed_ports
worker_allowed_ports = var.worker_allowed_ports

loadbalancer_enabled = var.loadbalancer_enabled
loadbalancer_plan = var.loadbalancer_plan
loadbalancers = var.loadbalancers
loadbalancer_enabled = var.loadbalancer_enabled
loadbalancer_plan = var.loadbalancer_plan
loadbalancer_outbound_proxy_protocol = var.loadbalancer_proxy_protocol ? "v2" : ""
loadbalancers = var.loadbalancers

server_groups = var.server_groups
}
Expand Down
3 changes: 3 additions & 0 deletions contrib/terraform/upcloud/modules/kubernetes-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ resource "upcloud_loadbalancer_backend" "lb_backend" {

loadbalancer = upcloud_loadbalancer.lb[0].id
name = "lb-backend-${each.key}"
properties {
outbound_proxy_protocol = var.loadbalancer_outbound_proxy_protocol
}
}

resource "upcloud_loadbalancer_frontend" "lb_frontend" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ variable "loadbalancer_plan" {
type = string
}

variable "loadbalancer_outbound_proxy_protocol" {
type = string
}

variable "loadbalancers" {
description = "Load balancers"

Expand Down
5 changes: 5 additions & 0 deletions contrib/terraform/upcloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ variable "loadbalancer_plan" {
default = "development"
}

variable "loadbalancer_proxy_protocol" {
type = bool
default = false
}

variable "loadbalancers" {
description = "Load balancers"

Expand Down

0 comments on commit 29fd3fc

Please sign in to comment.