20482: Allows the site admin to specify instance volume sizes per node.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 11 May 2023 13:03:20 +0000 (10:03 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 11 May 2023 13:03:20 +0000 (10:03 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/terraform/aws/services/main.tf
tools/salt-install/terraform/aws/services/terraform.tfvars
tools/salt-install/terraform/aws/services/variables.tf

index 06b89dc779cecf34d683b3c217aa353ecd999f93..9ca6d0fb1765f3073c5269461474ff07fda48d57 100644 (file)
@@ -57,15 +57,13 @@ resource "aws_instance" "arvados_service" {
   private_ip = local.private_ip[each.value]
   subnet_id = contains(local.user_facing_hosts, each.value) ? data.terraform_remote_state.vpc.outputs.public_subnet_id : data.terraform_remote_state.vpc.outputs.private_subnet_id
   vpc_security_group_ids = [ data.terraform_remote_state.vpc.outputs.arvados_sg_id ]
-  # This should be done in a more readable way
-  # iam_instance_profile = each.value == "controller" ? aws_iam_instance_profile.dispatcher_instance_profile.name : length(regexall("^keep[0-9]+", each.value)) > 0 ? aws_iam_instance_profile.keepstore_instance_profile.name : aws_iam_instance_profile.default_instance_profile.name
   iam_instance_profile = try(local.instance_profile[each.value], local.instance_profile.default).name
   tags = {
     Name = "${local.cluster_name}_arvados_service_${each.value}"
   }
   root_block_device {
     volume_type = "gp3"
-    volume_size = (each.value == "controller" && !local.use_external_db) ? 70 : 20
+    volume_size = try(var.instance_volume_size[each.value], var.instance_volume_size.default)
   }
 
   lifecycle {
index 856ea2396e03ae022d0e5f38d0be8a4c3cfc4677..3a2bf1d8e50bb181d514e1060b2b0174ed37330f 100644 (file)
 #   controller = "c5a.4xlarge"
 # }
 
+# Set the volume size (in GiB) per service node.
+# Default: 100 for controller, 20 the rest.
+# NOTE: The service node will need to be rebooted after increasing its volume's
+# size.
+# instance_volume_size = {
+#   default = 20
+#   controller = 300
+# }
+
 # AWS secret's name which holds the SSL certificate private key's password.
 # Default: "arvados-ssl-privkey-password"
 # ssl_password_secret_name_suffix = "some-name-suffix"
 
 # User for software deployment. Depends on the AMI's distro.
-# Default: 'admin'
+# Default: "admin"
 # deploy_user = "ubuntu"
 
 # Instance AMI to use for service nodes. Default: latest from Debian 11
index 08675a84f4fd1baeb6aae923b65a75d7a2895fb1..7e5d9056d41d9a579845bbe6fedb0b4531ad5cb3 100644 (file)
@@ -10,6 +10,15 @@ variable "instance_type" {
   }
 }
 
+variable "instance_volume_size" {
+  description = "EC2 volume size in GiB per service node"
+  type = map(number)
+  default = {
+    default = 20
+    controller = 100
+  }
+}
+
 variable "pubkey_path" {
   description = "Path to the file containing the public SSH key"
   type = string