Skip to content

Commit

Permalink
fix: default VM type
Browse files Browse the repository at this point in the history
  • Loading branch information
Telemaco019 committed Oct 18, 2024
1 parent c44f68a commit 466b624
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ You can find examples of code that uses this Terraform module in the [examples](
| <a name="input_gke_delete_protection"></a> [gke\_delete\_protection](#input\_gke\_delete\_protection) | Whether the GKE Cluster should have delete protection enabled. | `bool` | `true` | no |
| <a name="input_gke_kubernetes_version"></a> [gke\_kubernetes\_version](#input\_gke\_kubernetes\_version) | The used Kubernetes version for the GKE cluster. | `string` | `"1.30.3"` | no |
| <a name="input_gke_nebuly_namespaces"></a> [gke\_nebuly\_namespaces](#input\_gke\_nebuly\_namespaces) | The namespaces used by Nebuly installation. Update this if you use custom namespaces in the Helm chart installation. | `set(string)` | <pre>[<br/> "nebuly",<br/> "nebuly-bootstrap"<br/>]</pre> | no |
| <a name="input_gke_node_pools"></a> [gke\_node\_pools](#input\_gke\_node\_pools) | The node Pools used by the GKE cluster. | <pre>map(object({<br/> machine_type = string<br/> min_nodes = number<br/> max_nodes = number<br/> node_count = number<br/> node_locations = optional(set(string), null)<br/> preemptible = optional(bool, false)<br/> labels = optional(map(string), {})<br/> guest_accelerator = optional(object({<br/> type = string<br/> count = number<br/> }), null)<br/> }))</pre> | <pre>{<br/> "gpu-primary": {<br/> "guest_accelerator": {<br/> "count": 1,<br/> "type": "nvidia-l4"<br/> },<br/> "labels": {<br/> "gke-no-default-nvidia-gpu-device-plugin": true,<br/> "nebuly.com/accelerator": "nvidia-l4"<br/> },<br/> "machine_type": "g2-standard-8",<br/> "max_nodes": 1,<br/> "min_nodes": 0,<br/> "node_count": null<br/> },<br/> "gpu-secondary": {<br/> "guest_accelerator": {<br/> "count": 1,<br/> "type": "nvidia-tesla-t4"<br/> },<br/> "labels": {<br/> "gke-no-default-nvidia-gpu-device-plugin": true,<br/> "nebuly.com/accelerator": "nvidia-tesla-t4"<br/> },<br/> "machine_type": "n1-standard-4",<br/> "max_nodes": 1,<br/> "min_nodes": 0,<br/> "node_count": null<br/> },<br/> "web-services": {<br/> "machine_type": "n2-highmem-4",<br/> "max_nodes": 1,<br/> "min_nodes": 1,<br/> "node_count": 1<br/> }<br/>}</pre> | no |
| <a name="input_gke_node_pools"></a> [gke\_node\_pools](#input\_gke\_node\_pools) | The node Pools used by the GKE cluster. | <pre>map(object({<br/> machine_type = string<br/> min_nodes = number<br/> max_nodes = number<br/> node_count = number<br/> node_locations = optional(set(string), null)<br/> preemptible = optional(bool, false)<br/> labels = optional(map(string), {})<br/> taints = optional(set(object({<br/> key = string<br/> value = string<br/> effect = string<br/> })), null)<br/> guest_accelerator = optional(object({<br/> type = string<br/> count = number<br/> }), null)<br/> }))</pre> | <pre>{<br/> "gpu-primary": {<br/> "guest_accelerator": {<br/> "count": 1,<br/> "type": "nvidia-l4"<br/> },<br/> "labels": {<br/> "gke-no-default-nvidia-gpu-device-plugin": true,<br/> "nebuly.com/accelerator": "nvidia-l4"<br/> },<br/> "machine_type": "g2-standard-8",<br/> "max_nodes": 1,<br/> "min_nodes": 0,<br/> "node_count": null<br/> },<br/> "gpu-secondary": {<br/> "guest_accelerator": {<br/> "count": 1,<br/> "type": "nvidia-tesla-t4"<br/> },<br/> "labels": {<br/> "gke-no-default-nvidia-gpu-device-plugin": true,<br/> "nebuly.com/accelerator": "nvidia-tesla-t4"<br/> },<br/> "machine_type": "n1-standard-4",<br/> "max_nodes": 1,<br/> "min_nodes": 0,<br/> "node_count": null<br/> },<br/> "web-services": {<br/> "machine_type": "n4-highmem-4",<br/> "max_nodes": 1,<br/> "min_nodes": 1,<br/> "node_count": 1<br/> }<br/>}</pre> | no |
| <a name="input_gke_service_account_name"></a> [gke\_service\_account\_name](#input\_gke\_service\_account\_name) | The name of the Kubernetes Service Account used by Nebuly installation. | `string` | `"nebuly"` | no |
| <a name="input_k8s_image_pull_secret_name"></a> [k8s\_image\_pull\_secret\_name](#input\_k8s\_image\_pull\_secret\_name) | The name of the Kubernetes Image Pull Secret to use. <br/> This value will be used to auto-generate the values.yaml file for installing the Nebuly Platform Helm chart. | `string` | `"nebuly-docker-pull"` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | Common labels that will be applied to all resources. | `map(string)` | `{}` | no |
Expand Down Expand Up @@ -215,20 +215,20 @@ You can find examples of code that uses this Terraform module in the [examples](
- resource.google_compute_subnetwork.main (/terraform-docs/main.tf#50)
- resource.google_container_cluster.main (/terraform-docs/main.tf#206)
- resource.google_container_node_pool.main (/terraform-docs/main.tf#253)
- resource.google_project_iam_binding.gke_cluster_admin (/terraform-docs/main.tf#321)
- resource.google_project_iam_member.gke_secret_accessors (/terraform-docs/main.tf#298)
- resource.google_secret_manager_secret.jwt_signing_key (/terraform-docs/main.tf#338)
- resource.google_secret_manager_secret.nebuly_client_id (/terraform-docs/main.tf#365)
- resource.google_secret_manager_secret.nebuly_client_secret (/terraform-docs/main.tf#377)
- resource.google_secret_manager_secret.openai_api_key (/terraform-docs/main.tf#353)
- resource.google_project_iam_binding.gke_cluster_admin (/terraform-docs/main.tf#337)
- resource.google_project_iam_member.gke_secret_accessors (/terraform-docs/main.tf#314)
- resource.google_secret_manager_secret.jwt_signing_key (/terraform-docs/main.tf#354)
- resource.google_secret_manager_secret.nebuly_client_id (/terraform-docs/main.tf#381)
- resource.google_secret_manager_secret.nebuly_client_secret (/terraform-docs/main.tf#393)
- resource.google_secret_manager_secret.openai_api_key (/terraform-docs/main.tf#369)
- resource.google_secret_manager_secret.postgres_analytics_password (/terraform-docs/main.tf#150)
- resource.google_secret_manager_secret.postgres_analytics_username (/terraform-docs/main.tf#138)
- resource.google_secret_manager_secret.postgres_auth_password (/terraform-docs/main.tf#191)
- resource.google_secret_manager_secret.postgres_auth_username (/terraform-docs/main.tf#179)
- resource.google_secret_manager_secret_version.jwt_signing_key (/terraform-docs/main.tf#346)
- resource.google_secret_manager_secret_version.nebuly_client_id (/terraform-docs/main.tf#373)
- resource.google_secret_manager_secret_version.nebuly_client_secret (/terraform-docs/main.tf#385)
- resource.google_secret_manager_secret_version.openai_api_key (/terraform-docs/main.tf#361)
- resource.google_secret_manager_secret_version.jwt_signing_key (/terraform-docs/main.tf#362)
- resource.google_secret_manager_secret_version.nebuly_client_id (/terraform-docs/main.tf#389)
- resource.google_secret_manager_secret_version.nebuly_client_secret (/terraform-docs/main.tf#401)
- resource.google_secret_manager_secret_version.openai_api_key (/terraform-docs/main.tf#377)
- resource.google_secret_manager_secret_version.postgres_analytics_password (/terraform-docs/main.tf#158)
- resource.google_secret_manager_secret_version.postgres_analytics_username (/terraform-docs/main.tf#146)
- resource.google_secret_manager_secret_version.postgres_auth_password (/terraform-docs/main.tf#199)
Expand All @@ -240,11 +240,11 @@ You can find examples of code that uses this Terraform module in the [examples](
- resource.google_sql_database_instance.main (/terraform-docs/main.tf#82)
- resource.google_sql_user.analytics (/terraform-docs/main.tf#133)
- resource.google_sql_user.auth (/terraform-docs/main.tf#174)
- resource.google_storage_bucket.main (/terraform-docs/main.tf#391)
- resource.google_storage_bucket_iam_binding.gke_storage_object_user (/terraform-docs/main.tf#309)
- resource.google_storage_bucket.main (/terraform-docs/main.tf#407)
- resource.google_storage_bucket_iam_binding.gke_storage_object_user (/terraform-docs/main.tf#325)
- resource.random_password.analytics (/terraform-docs/main.tf#128)
- resource.random_password.auth (/terraform-docs/main.tf#169)
- resource.tls_private_key.jwt_signing_key (/terraform-docs/main.tf#334)
- resource.tls_private_key.jwt_signing_key (/terraform-docs/main.tf#350)
- data source.google_compute_zones.available (/terraform-docs/main.tf#23)
- data source.google_container_engine_versions.main (/terraform-docs/main.tf#24)
- data source.google_project.current (/terraform-docs/main.tf#22)
9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ resource "google_container_node_pool" "main" {

labels = each.value.labels

dynamic "taint" {
for_each = each.value.taints == null ? [] : each.value.taints
content {
key = taint.value.key
value = taint.value.value
effect = taint.value.effect
}
}

dynamic "guest_accelerator" {
for_each = each.value.guest_accelerator == null ? {} : { "" : each.value.guest_accelerator }
content {
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,19 @@ variable "gke_node_pools" {
node_locations = optional(set(string), null)
preemptible = optional(bool, false)
labels = optional(map(string), {})
taints = optional(set(object({
key = string
value = string
effect = string
})), null)
guest_accelerator = optional(object({
type = string
count = number
}), null)
}))
default = {
"web-services" : {
machine_type = "n2-highmem-4"
machine_type = "n4-highmem-4"
min_nodes = 1
max_nodes = 1
node_count = 1
Expand Down

0 comments on commit 466b624

Please sign in to comment.