Skip to content

Commit

Permalink
Merge pull request #69 from castai/add-extended-memory-enabled-nt-prop
Browse files Browse the repository at this point in the history
chore: add custom_instances_with_extended_memory_enabled node template support
  • Loading branch information
saumas authored May 14, 2024
2 parents 63184c1 + 7254a51 commit 15257c5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
45 changes: 23 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ For Phase 2 onboarding credentials from `terraform-gke-iam` are required
```hcl
module "castai_gke_cluster" {
source = "castai/gke-cluster/castai"
project_id = var.project_id
gke_cluster_name = var.cluster_name
gke_cluster_location = module.gke.location # cluster region or zone
gke_credentials = module.castai_gke_iam.private_key
project_id = var.project_id
gke_cluster_name = var.cluster_name
gke_cluster_location = module.gke.location # cluster region or zone
gke_credentials = module.castai_gke_iam.private_key
delete_nodes_on_disconnect = var.delete_nodes_on_disconnect
autoscaler_policies_json = var.autoscaler_policies_json
autoscaler_policies_json = var.autoscaler_policies_json
default_node_configuration = module.castai_gke_cluster.node_configurations["default"]
node_configurations = {
default = {
disk_cpu_ratio = 25
subnets = [module.vpc.subnets_ids[0]]
tags = {
tags = {
"node-config" : "default"
}
max_pods_per_node = 110
network_tags = ["dev"]
disk_type = "pd-balanced"
max_pods_per_node = 110
network_tags = ["dev"]
disk_type = "pd-balanced"
}
}
node_templates = {
Expand All @@ -63,31 +63,32 @@ module "castai_gke_cluster" {
custom_taints = [
{
key = "custom-taint-key-1"
key = "custom-taint-key-1"
value = "custom-taint-value-1"
},
{
key = "custom-taint-key-2"
key = "custom-taint-key-2"
value = "custom-taint-value-2"
}
]
constraints = {
fallback_restore_rate_seconds = 1800
spot = true
use_spot_fallbacks = true
min_cpu = 4
max_cpu = 100
spot = true
use_spot_fallbacks = true
min_cpu = 4
max_cpu = 100
instance_families = {
exclude = ["e2"]
}
compute_optimized_state = "disabled"
storage_optimized_state = "disabled"
is_gpu_only = false
architectures = ["amd64"]
is_gpu_only = false
architectures = ["amd64"]
}
custom_instances_enabled = true
custom_instances_enabled = true
custom_instances_with_extended_memory_enabled = true
}
}
}
Expand Down Expand Up @@ -177,7 +178,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta

| Name | Version |
|------|---------|
| <a name="provider_castai"></a> [castai](#provider\_castai) | ~> 7.0.0|
| <a name="provider_castai"></a> [castai](#provider\_castai) | ~> 7.0.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.0.0 |
| <a name="provider_null"></a> [null](#provider\_null) | n/a |

Expand Down
17 changes: 9 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ resource "castai_node_template" "this" {

cluster_id = castai_gke_cluster.castai_cluster.id

name = try(each.value.name, each.key)
configuration_id = try(each.value.configuration_id, null)
is_default = try(each.value.is_default, false)
is_enabled = try(each.value.is_enabled, true)
should_taint = try(each.value.should_taint, true)
custom_instances_enabled = try(each.value.custom_instances_enabled, false)
name = try(each.value.name, each.key)
configuration_id = try(each.value.configuration_id, null)
is_default = try(each.value.is_default, false)
is_enabled = try(each.value.is_enabled, true)
should_taint = try(each.value.should_taint, true)
custom_instances_enabled = try(each.value.custom_instances_enabled, false)
custom_instances_with_extended_memory_enabled = try(each.value.custom_instances_with_extended_memory_enabled, false)

custom_labels = try(each.value.custom_labels, {})

Expand All @@ -62,8 +63,8 @@ resource "castai_node_template" "this" {
content {
compute_optimized = try(constraints.value.compute_optimized, null)
storage_optimized = try(constraints.value.storage_optimized, null)
compute_optimized_state = try(constraints.value.compute_optimized_state, "")
storage_optimized_state = try(constraints.value.storage_optimized_state, "")
compute_optimized_state = try(constraints.value.compute_optimized_state, "")
storage_optimized_state = try(constraints.value.storage_optimized_state, "")
is_gpu_only = try(constraints.value.is_gpu_only, false)
spot = try(constraints.value.spot, false)
on_demand = try(constraints.value.on_demand, null)
Expand Down

0 comments on commit 15257c5

Please sign in to comment.