Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow traefik requests and limits customization #1580

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -727,11 +727,11 @@ additionalArguments:
%{if var.traefik_resource_limits~}
resources:
requests:
cpu: "100m"
memory: "50Mi"
cpu: "${var.traefik_resource_values.requests.cpu}"
memory: "${var.traefik_resource_values.requests.memory}"
limits:
cpu: "300m"
memory: "150Mi"
cpu: "${var.traefik_resource_values.limits.cpu}"
memory: "${var.traefik_resource_values.limits.memory}"
%{endif~}
%{if var.traefik_autoscaling~}
autoscaling:
Expand Down
24 changes: 24 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable "hcloud_token" {

Check failure on line 1 in variables.tf

View workflow job for this annotation

GitHub Actions / Check formatting of terraform files

File is not in canonical format (terraform fmt)
description = "Hetzner Cloud API Token."
type = string
sensitive = true
Expand Down Expand Up @@ -454,6 +454,30 @@
description = "Should traefik enable default resource requests and limits. Default values are requests: 100m & 50Mi and limits: 300m & 150Mi."
}

variable "traefik_resource_values" {
type = object({
requests = object({
cpu = string
memory = string
})
limits = object({
cpu = string
memory = string
})
})
default = {
requests = {
memory = "50Mi"
cpu = "100m"
}
limits = {
memory = "150Mi"
cpu = "300m"
}
}
description = "Requests and limits for Traefik."
}

variable "traefik_additional_ports" {
type = list(object({
name = string
Expand Down
Loading