Uniform way of declaring resource requests
Closed this issue · 5 comments
anarsen commented
Instead of having two variables for accepting resource requests for pods, perhaps we could come up with another way.
Instead of
variable "resource_requests_cpu" {
type = number
}
variable "resource_requests_memory" {
type = number
}
then something like
variable "resource_requests" {
type = map(number)
default = {
cpu = 100
memory = 100
}
}
qvistgaard commented
I think it is a great idea.
anarsen commented
We can actually go a bit further with the type annotation and validate the object keys too
variable "resource_requests" {
type = object({
cpu = number
memory = number
})
default = {
cpu = 100
memory = 100
}
}
cc @wolffberg
qvistgaard commented
How would you suggest we define limits, cpu should be optional and omittet if not set
anarsen commented
IMO our add-ons must define, although low, default resource requests. Otherwise they'll get their QoS classified as best effort, which we probably don't want for components we consider "must-haves".
qvistgaard commented
I agree, requests must always be set, however in some cases it could make sense not to set cpu limit.