Skip to content

Commit

Permalink
Make OS disk size even more configurable
Browse files Browse the repository at this point in the history
OS disk sizes are now separately configured for private, development
and production environments.

Signed-off-by: Tero Tervala <tero.tervala@unikie.com>
  • Loading branch information
tervis-unikie committed Mar 6, 2024
1 parent 84247b9 commit 86bd4e1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion terraform/binary-cache.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module "binary_cache_vm" {
location = azurerm_resource_group.infra.location
virtual_machine_name = "ghaf-binary-cache-${local.env}"
virtual_machine_size = local.opts[local.conf].vm_size_binarycache
virtual_machine_osdisk_size = "50"
virtual_machine_osdisk_size = local.opts[local.conf].osdisk_size_binarycache
virtual_machine_source_image = module.binary_cache_image.image_id

virtual_machine_custom_data = join("\n", ["#cloud-config", yamlencode({
Expand Down
2 changes: 1 addition & 1 deletion terraform/builder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module "builder_vm" {
location = azurerm_resource_group.infra.location
virtual_machine_name = "ghaf-builder-${count.index}-${local.env}"
virtual_machine_size = local.opts[local.conf].vm_size_builder
virtual_machine_osdisk_size = "150"
virtual_machine_osdisk_size = local.opts[local.conf].osdisk_size_builder
virtual_machine_source_image = module.builder_image.image_id

virtual_machine_custom_data = join("\n", ["#cloud-config", yamlencode({
Expand Down
2 changes: 1 addition & 1 deletion terraform/jenkins-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module "jenkins_controller_vm" {
location = azurerm_resource_group.infra.location
virtual_machine_name = "ghaf-jenkins-controller-${local.env}"
virtual_machine_size = local.opts[local.conf].vm_size_controller
virtual_machine_osdisk_size = "150"
virtual_machine_osdisk_size = local.opts[local.conf].osdisk_size_controller
virtual_machine_source_image = module.jenkins_controller_image.image_id

virtual_machine_custom_data = join("\n", ["#cloud-config", yamlencode({
Expand Down
33 changes: 21 additions & 12 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,31 @@ locals {
# E.g. 'Standard_D2_v3' means: 2 vCPU, 8 GiB RAM
opts = {
priv = {
vm_size_binarycache = "Standard_D2_v3"
vm_size_builder = "Standard_D2_v3"
vm_size_controller = "Standard_E2_v5"
num_builders = 1
vm_size_binarycache = "Standard_D2_v3"
osdisk_size_binarycache = "50"
vm_size_builder = "Standard_D2_v3"
osdisk_size_builder = "150"
vm_size_controller = "Standard_E2_v5"
osdisk_size_controller = "150"
num_builders = 1
}
dev = {
vm_size_binarycache = "Standard_D2_v3"
vm_size_builder = "Standard_D4_v3"
vm_size_controller = "Standard_E4_v5"
num_builders = 1
vm_size_binarycache = "Standard_D2_v3"
osdisk_size_binarycache = "250"
vm_size_builder = "Standard_D4_v3"
osdisk_size_builder = "250"
vm_size_controller = "Standard_E4_v5"
osdisk_size_controller = "500"
num_builders = 1
}
prod = {
vm_size_binarycache = "Standard_D2_v3"
vm_size_builder = "Standard_D8_v3"
vm_size_controller = "Standard_E4_v5"
num_builders = 2
vm_size_binarycache = "Standard_D2_v3"
osdisk_size_binarycache = "250"
vm_size_builder = "Standard_D8_v3"
osdisk_size_builder = "500"
vm_size_controller = "Standard_E4_v5"
osdisk_size_controller = "1000"
num_builders = 2
}
}

Expand Down

0 comments on commit 86bd4e1

Please sign in to comment.