Skip to content

Commit

Permalink
only set mem/cpu setting if limit is set
Browse files Browse the repository at this point in the history
Otherwise, we get the too-low setting of the request, which
will be a rough experience for folks who have been using the operator
and are used to the experience of having entire underlying node capacity

Users can still set the setting via extra_settings to get the experience
of having each pod with a individualized capacity, or set a limit.
  • Loading branch information
kdelee committed Feb 15, 2022
1 parent 7807bc5 commit 479c009
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roles/installer/templates/config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ data:

# Set memory available based off of resource request/limit for the task pod
memory_limit = '{{ task_resource_requirements["limits"]["memory"] if "limits" in task_resource_requirements and "memory" in task_resource_requirements["limits"] }}'
memory_request = '{{ task_resource_requirements["requests"]["memory"] if "requests" in task_resource_requirements and "memory" in task_resource_requirements["requests"] }}'
SYSTEM_TASK_ABS_MEM = memory_limit if memory_limit else memory_request
if memory_limit:
SYSTEM_TASK_ABS_MEM = memory_limit

# Set cpu available based off of resource request/limit for the task pod
cpu_limit = '{{ task_resource_requirements["limits"]["cpu"] if "limits" in task_resource_requirements and "cpu" in task_resource_requirements["limits"] }}'
cpu_request = '{{ task_resource_requirements["requests"]["cpu"] if "requests" in task_resource_requirements and "cpu" in task_resource_requirements["requests"] }}'
SYSTEM_TASK_ABS_CPU = cpu_limit if cpu_limit else cpu_request
if cpu_limit:
SYSTEM_TASK_ABS_CPU = cpu_limit

SECRET_KEY = get_secret()

Expand Down

0 comments on commit 479c009

Please sign in to comment.