Merge pull request #1783 from coreos-inc/qemu-disk-size
Fix k8s builder to use the declared volume size
This commit is contained in:
commit
80d1821c88
2 changed files with 4 additions and 0 deletions
|
@ -324,6 +324,7 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
|
|
||||||
def _job_resource(self, build_uuid, user_data, coreos_channel='stable'):
|
def _job_resource(self, build_uuid, user_data, coreos_channel='stable'):
|
||||||
vm_memory_limit = self.executor_config.get('VM_MEMORY_LIMIT', '8G')
|
vm_memory_limit = self.executor_config.get('VM_MEMORY_LIMIT', '8G')
|
||||||
|
vm_volume_size = self.executor_config.get('VOLUME_SIZE', '32G')
|
||||||
|
|
||||||
# Max values for this container
|
# Max values for this container
|
||||||
container_limits = {
|
container_limits = {
|
||||||
|
@ -375,6 +376,7 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
'env': [
|
'env': [
|
||||||
{'name': 'USERDATA', 'value': user_data},
|
{'name': 'USERDATA', 'value': user_data},
|
||||||
{'name': 'VM_MEMORY', 'value': vm_memory_limit},
|
{'name': 'VM_MEMORY', 'value': vm_memory_limit},
|
||||||
|
{'name': 'VM_VOLUME_SIZE', 'value': vm_volume_size},
|
||||||
],
|
],
|
||||||
'limits' : container_limits,
|
'limits' : container_limits,
|
||||||
'requests' : container_requests,
|
'requests' : container_requests,
|
||||||
|
|
|
@ -7,6 +7,8 @@ set -o nounset
|
||||||
mkdir -p /userdata/openstack/latest
|
mkdir -p /userdata/openstack/latest
|
||||||
echo "$USERDATA" > /userdata/openstack/latest/user_data
|
echo "$USERDATA" > /userdata/openstack/latest/user_data
|
||||||
|
|
||||||
|
qemu-img resize ./coreos_production_qemu_image.img "${VM_VOLUME_SIZE}"
|
||||||
|
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
-cpu host \
|
-cpu host \
|
||||||
|
|
Reference in a new issue