From cee7c4be9629d11e20406ccbc13c016741eec269 Mon Sep 17 00:00:00 2001 From: Brad Ison Date: Tue, 4 Oct 2016 11:56:06 -0400 Subject: [PATCH] Fix kubernetes resource limits --- buildman/manager/executor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buildman/manager/executor.py b/buildman/manager/executor.py index 554c4b490..15da0e7a1 100644 --- a/buildman/manager/executor.py +++ b/buildman/manager/executor.py @@ -347,9 +347,11 @@ class KubernetesExecutor(BuilderExecutor): } # Minimum acceptable free resources for this container to "fit" in a quota + # These may be lower than the aboslute limits if the cluster is knowingly + # oversubscribed by some amount. container_requests = { - 'memory' : self.executor_config.get('CONTAINER_MEMORY_REQUEST', '4Gi'), - 'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "2"), + 'memory' : self.executor_config.get('CONTAINER_MEMORY_REQUEST', '3968Mi'), + 'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "1"), } release_sha = release.GIT_HEAD or 'none' @@ -392,8 +394,10 @@ class KubernetesExecutor(BuilderExecutor): {'name': 'VM_MEMORY', 'value': vm_memory_limit}, {'name': 'VM_VOLUME_SIZE', 'value': vm_volume_size}, ], - 'limits' : container_limits, - 'requests' : container_requests, + 'resources': { + 'limits': container_limits, + 'requests': container_requests, + }, }, ], 'imagePullSecrets': [{'name': 'builder'}],