Fix kubernetes resource limits

This commit is contained in:
Brad Ison 2016-10-04 11:56:06 -04:00
parent 943a20f042
commit cee7c4be96

View file

@ -347,9 +347,11 @@ class KubernetesExecutor(BuilderExecutor):
} }
# Minimum acceptable free resources for this container to "fit" in a quota # 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 = { container_requests = {
'memory' : self.executor_config.get('CONTAINER_MEMORY_REQUEST', '4Gi'), 'memory' : self.executor_config.get('CONTAINER_MEMORY_REQUEST', '3968Mi'),
'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "2"), 'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "1"),
} }
release_sha = release.GIT_HEAD or 'none' release_sha = release.GIT_HEAD or 'none'
@ -392,8 +394,10 @@ class KubernetesExecutor(BuilderExecutor):
{'name': 'VM_MEMORY', 'value': vm_memory_limit}, {'name': 'VM_MEMORY', 'value': vm_memory_limit},
{'name': 'VM_VOLUME_SIZE', 'value': vm_volume_size}, {'name': 'VM_VOLUME_SIZE', 'value': vm_volume_size},
], ],
'limits' : container_limits, 'resources': {
'requests' : container_requests, 'limits': container_limits,
'requests': container_requests,
},
}, },
], ],
'imagePullSecrets': [{'name': 'builder'}], 'imagePullSecrets': [{'name': 'builder'}],