Skip to content

Commit

Permalink
fix: allow configurable storage class for instances (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf31o2 authored Jul 2, 2024
1 parent e23d4e6 commit 60e5b41
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
4 changes: 4 additions & 0 deletions bootstrap/instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ variable "node_resources" {
}
}

variable "storage_class_name" {
default = "gp3"
}

variable "storage_size" {
default = "50Gi"
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/instance/node.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "kubernetes_stateful_set_v1" "node" {
}
spec {
access_modes = ["ReadWriteOnce"]
storage_class_name = "gp3"
storage_class_name = var.storage_class_name
resources {
requests = {
storage = var.storage_size
Expand Down
31 changes: 16 additions & 15 deletions bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,21 @@ module "instances" {
"cpu" = "100m"
}
})
storage_size = coalesce(each.value.storage_size, "50Gi")
node_image = each.value.node_image
node_image_tag = each.value.image_tag
release = each.value.release
network = each.value.network
magic = each.value.magic
topology_zone = each.value.topology_zone
salt = each.value.salt
compute_arch = coalesce(each.value.compute_arch, "arm64")
compute_profile = coalesce(each.value.compute_profile, "mem-intensive")
availability_sla = coalesce(each.value.availability_sla, "consistent")
node_version = each.value.node_version
restore = coalesce(each.value.restore, false)
is_custom = coalesce(each.value.is_custom, false)
storage_class_name = coalesce(each.value.storage_class_name, "gp3")
storage_size = coalesce(each.value.storage_size, "50Gi")
node_image = each.value.node_image
node_image_tag = each.value.image_tag
release = each.value.release
network = each.value.network
magic = each.value.magic
topology_zone = each.value.topology_zone
salt = each.value.salt
compute_arch = coalesce(each.value.compute_arch, "arm64")
compute_profile = coalesce(each.value.compute_profile, "mem-intensive")
availability_sla = coalesce(each.value.availability_sla, "consistent")
node_version = each.value.node_version
restore = coalesce(each.value.restore, false)
is_custom = coalesce(each.value.is_custom, false)
}


Expand Down Expand Up @@ -111,4 +112,4 @@ module "node_relay" {
depends_on = [kubernetes_namespace.namespace]
source = "./relay"
namespace = var.namespace
}
}
17 changes: 9 additions & 8 deletions bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ variable "instances" {
memory = string
})
}))
storage_size = optional(string)
node_version = string
replicas = number
restore = optional(bool)
compute_arch = optional(string)
compute_profile = optional(string)
availability_sla = optional(string)
is_custom = optional(bool)
storage_size = optional(string)
storage_class_name = optional(string, "gp3")
node_version = string
replicas = number
restore = optional(bool)
compute_arch = optional(string)
compute_profile = optional(string)
availability_sla = optional(string)
is_custom = optional(bool)
}))
}

Expand Down

0 comments on commit 60e5b41

Please sign in to comment.