Skip to content

Commit

Permalink
Add options for create and update timeouts to gke modules
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-stroud committed Jun 9, 2023
1 parent c18604a commit 9247059
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions community/modules/compute/gke-node-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ No modules.
| <a name="input_spot"></a> [spot](#input\_spot) | Provision VMs using discounted Spot pricing, allowing for preemption | `bool` | `false` | no |
| <a name="input_taints"></a> [taints](#input\_taints) | Taints to be applied to the system node pool. | <pre>list(object({<br> key = string<br> value = any<br> effect = string<br> }))</pre> | <pre>[<br> {<br> "effect": "NO_SCHEDULE",<br> "key": "user-workload",<br> "value": true<br> }<br>]</pre> | no |
| <a name="input_threads_per_core"></a> [threads\_per\_core](#input\_threads\_per\_core) | Sets the number of threads per physical core. By setting threads\_per\_core<br>to 2, Simultaneous Multithreading (SMT) is enabled extending the total number<br>of virtual cores. For example, a machine of type c2-standard-60 will have 60<br>virtual cores with threads\_per\_core equal to 2. With threads\_per\_core equal<br>to 1 (SMT turned off), only the 30 physical cores will be available on the VM.<br><br>The default value of \"0\" will turn off SMT for supported machine types, and<br>will fall back to GCE defaults for unsupported machine types (t2d, shared-core<br>instances, or instances with less than 2 vCPU).<br><br>Disabling SMT can be more performant in many HPC workloads, therefore it is<br>disabled by default where compatible.<br><br>null = SMT configuration will use the GCE defaults for the machine type<br>0 = SMT will be disabled where compatible (default)<br>1 = SMT will always be disabled (will fail on incompatible machine types)<br>2 = SMT will always be enabled (will fail on incompatible machine types) | `number` | `0` | no |
| <a name="input_timeout_create"></a> [timeout\_create](#input\_timeout\_create) | Timeout for creating a node pool | `string` | `null` | no |
| <a name="input_timeout_update"></a> [timeout\_update](#input\_timeout\_update) | Timeout for updating a node pool | `string` | `null` | no |
| <a name="input_total_max_nodes"></a> [total\_max\_nodes](#input\_total\_max\_nodes) | Total maximum number of nodes in the NodePool. | `number` | `1000` | no |
| <a name="input_total_min_nodes"></a> [total\_min\_nodes](#input\_total\_min\_nodes) | Total minimum number of nodes in the NodePool. | `number` | `0` | no |
| <a name="input_zones"></a> [zones](#input\_zones) | A list of zones to be used. Zones must be in region of cluster. If null, cluster zones will be inherited. Note `zones` not `zone`; does not work with `zone` deployment variable. | `list(string)` | `null` | no |
Expand Down
5 changes: 5 additions & 0 deletions community/modules/compute/gke-node-pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ resource "google_container_node_pool" "node_pool" {
}
}

timeouts {
create = var.timeout_create
update = var.timeout_update
}

lifecycle {
ignore_changes = [
node_config[0].labels,
Expand Down
12 changes: 12 additions & 0 deletions community/modules/compute/gke-node-pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,15 @@ variable "labels" {
description = "GCE resource labels to be applied to resources. Key-value pairs."
type = map(string)
}

variable "timeout_create" {
description = "Timeout for creating a node pool"
type = string
default = null
}

variable "timeout_update" {
description = "Timeout for updating a node pool"
type = string
default = null
}
2 changes: 2 additions & 0 deletions community/modules/scheduler/gke-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ No modules.
| <a name="input_system_node_pool_name"></a> [system\_node\_pool\_name](#input\_system\_node\_pool\_name) | Name of the system node pool. | `string` | `"system"` | no |
| <a name="input_system_node_pool_node_count"></a> [system\_node\_pool\_node\_count](#input\_system\_node\_pool\_node\_count) | The total min and max nodes to be maintained in the system node pool. | <pre>object({<br> total_min_nodes = number<br> total_max_nodes = number<br> })</pre> | <pre>{<br> "total_max_nodes": 10,<br> "total_min_nodes": 2<br>}</pre> | no |
| <a name="input_system_node_pool_taints"></a> [system\_node\_pool\_taints](#input\_system\_node\_pool\_taints) | Taints to be applied to the system node pool. | <pre>list(object({<br> key = string<br> value = any<br> effect = string<br> }))</pre> | <pre>[<br> {<br> "effect": "NO_SCHEDULE",<br> "key": "components.gke.io/gke-managed-components",<br> "value": true<br> }<br>]</pre> | no |
| <a name="input_timeout_create"></a> [timeout\_create](#input\_timeout\_create) | Timeout for creating a node pool | `string` | `null` | no |
| <a name="input_timeout_update"></a> [timeout\_update](#input\_timeout\_update) | Timeout for updating a node pool | `string` | `null` | no |

## Outputs

Expand Down
5 changes: 5 additions & 0 deletions community/modules/scheduler/gke-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ resource "google_container_cluster" "gke_cluster" {
}
}

timeouts {
create = var.timeout_create
update = var.timeout_update
}

lifecycle {
# Ignore all changes to the default node pool. It's being removed after creation.
ignore_changes = [
Expand Down
12 changes: 12 additions & 0 deletions community/modules/scheduler/gke-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,15 @@ variable "labels" {
description = "GCE resource labels to be applied to resources. Key-value pairs."
type = map(string)
}

variable "timeout_create" {
description = "Timeout for creating a node pool"
type = string
default = null
}

variable "timeout_update" {
description = "Timeout for updating a node pool"
type = string
default = null
}

0 comments on commit 9247059

Please sign in to comment.