Skip to content

Commit 00eaa59

Browse files
committed
feat: add variables to set resource requests/limits on repo-server plugins
1 parent 68376a5 commit 00eaa59

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

locals.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ locals {
7878
]
7979
# The extra containers of the repo_server pod must have resource requests/limits in order to allow this component
8080
# to autoscale properly.
81-
resources = { # TODO Maybe these resources should be different from the repo_server one.
82-
requests = { for k, v in var.resources.repo_server.requests : k => v if v != null }
83-
limits = { for k, v in var.resources.repo_server.limits : k => v if v != null }
81+
resources = {
82+
requests = { for k, v in var.resources.kustomized_helm_cmp.requests : k => v if v != null }
83+
limits = { for k, v in var.resources.kustomized_helm_cmp.limits : k => v if v != null }
8484
}
8585
},
8686
{
@@ -111,9 +111,9 @@ locals {
111111
]
112112
# The extra containers of the repo_server pod must have resource requests/limits in order to allow this component
113113
# to autoscale properly.
114-
resources = { # TODO Maybe these resources should be different from the repo_server one.
115-
requests = { for k, v in var.resources.repo_server.requests : k => v if v != null }
116-
limits = { for k, v in var.resources.repo_server.limits : k => v if v != null }
114+
resources = {
115+
requests = { for k, v in var.resources.helmfile_cmp.requests : k => v if v != null }
116+
limits = { for k, v in var.resources.helmfile_cmp.limits : k => v if v != null }
117117
}
118118
}
119119
]

variables.tf

+22
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,28 @@ variable "resources" {
128128
}), {})
129129
}), {})
130130

131+
kustomized_helm_cmp = optional(object({
132+
requests = optional(object({
133+
cpu = optional(string, "100m")
134+
memory = optional(string, "128Mi")
135+
}), {})
136+
limits = optional(object({
137+
cpu = optional(string)
138+
memory = optional(string)
139+
}), {})
140+
}), {})
141+
142+
helmfile_cmp = optional(object({
143+
requests = optional(object({
144+
cpu = optional(string, "100m")
145+
memory = optional(string, "128Mi")
146+
}), {})
147+
limits = optional(object({
148+
cpu = optional(string)
149+
memory = optional(string)
150+
}), {})
151+
}), {})
152+
131153
server = optional(object({
132154
requests = optional(object({
133155
cpu = optional(string, "50m")

0 commit comments

Comments
 (0)