Merge pull request #1937 from coreos-inc/k8s-resource-limits

Fix kubernetes resource limits
This commit is contained in:
Brad Ison 2016-10-04 14:11:46 -04:00 committed by GitHub
commit febf3751c0

View file

@ -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'}],