Skip to content

Commit

Permalink
feat: add min disk size to node configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aldor007 committed May 16, 2023
1 parent 2e63084 commit 76cd543
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ resource "castai_gke_cluster" "castai_cluster" {
}

resource "castai_node_configuration" "this" {
for_each = {for k, v in var.node_configurations : k => v}
for_each = { for k, v in var.node_configurations : k => v }

cluster_id = castai_gke_cluster.castai_cluster.id

name = try(each.value.name, each.key)
disk_cpu_ratio = try(each.value.disk_cpu_ratio, 0)
min_disk_size = try(each.value.min_disk_size, 100)
subnets = try(each.value.subnets, null)
ssh_public_key = try(each.value.ssh_public_key, null)
image = try(each.value.image, null)
Expand All @@ -29,7 +30,7 @@ resource "castai_node_configuration_default" "this" {
}

resource "castai_node_template" "this" {
for_each = {for k, v in var.node_templates : k => v}
for_each = { for k, v in var.node_templates : k => v }

cluster_id = castai_gke_cluster.castai_cluster.id

Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ output "cluster_id" {

output "castai_node_configurations" {
description = "Map of node configurations ids by name"
value = {
value = {
for k, v in castai_node_configuration.this : v.name => v.id
}
}
Expand Down
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variable "gke_credentials" {
}

variable "castai_components_labels" {
type = map
type = map(any)
description = "Optional additional Kubernetes labels for CAST AI pods"
default = {}
}
Expand All @@ -61,8 +61,8 @@ variable "node_templates" {
}

variable "install_security_agent" {
type = bool
default = false
type = bool
default = false
description = "Optional flag for installation of security agent (https://docs.cast.ai/product-overview/console/security-insights/)"
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
}
castai = {
source = "castai/castai"
version = ">= 3.6.0"
version = ">= 3.8.0"
}
helm = {
source = "hashicorp/helm"
Expand Down

0 comments on commit 76cd543

Please sign in to comment.