Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose maintenance interval as a blueprint setting for node pools in GKE #2971

1 change: 1 addition & 0 deletions modules/compute/gke-node-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ No modules.
| <a name="input_enable_gcfs"></a> [enable\_gcfs](#input\_enable\_gcfs) | Enable the Google Container Filesystem (GCFS). See [restrictions](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#gcfs_config). | `bool` | `false` | no |
| <a name="input_enable_secure_boot"></a> [enable\_secure\_boot](#input\_enable\_secure\_boot) | Enable secure boot for the nodes. Keep enabled unless custom kernel modules need to be loaded. See [here](https://cloud.google.com/compute/shielded-vm/docs/shielded-vm#secure-boot) for more info. | `bool` | `true` | no |
| <a name="input_guest_accelerator"></a> [guest\_accelerator](#input\_guest\_accelerator) | List of the type and count of accelerator cards attached to the instance. | <pre>list(object({<br> type = optional(string)<br> count = optional(number, 0)<br> gpu_driver_installation_config = optional(list(object({<br> gpu_driver_version = string<br> })))<br> gpu_partition_size = optional(string)<br> gpu_sharing_config = optional(list(object({<br> gpu_sharing_strategy = optional(string)<br> max_shared_clients_per_gpu = optional(number)<br> })))<br> }))</pre> | `null` | no |
| <a name="input_host_maintenance_interval"></a> [host\_maintenance\_interval](#input\_host\_maintenance\_interval) | Specifies the frequency of planned maintenance events. | `string` | `""` | no |
| <a name="input_image_type"></a> [image\_type](#input\_image\_type) | The default image type used by NAP once a new node pool is being created. Use either COS\_CONTAINERD or UBUNTU\_CONTAINERD. | `string` | `"COS_CONTAINERD"` | no |
| <a name="input_kubernetes_labels"></a> [kubernetes\_labels](#input\_kubernetes\_labels) | Kubernetes labels to be applied to each node in the node group. Key-value pairs. <br>(The `kubernetes.io/` and `k8s.io/` prefixes are reserved by Kubernetes Core components and cannot be specified) | `map(string)` | `null` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | GCE resource labels to be applied to resources. Key-value pairs. | `map(string)` | n/a | yes |
Expand Down
7 changes: 7 additions & 0 deletions modules/compute/gke-node-pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ resource "google_container_node_pool" "node_pool" {
key = var.specific_reservation.key
values = var.specific_reservation.values
}

dynamic "host_maintenance_policy" {
ankitkinra marked this conversation as resolved.
Show resolved Hide resolved
for_each = true ? [1] : []
annuay-google marked this conversation as resolved.
Show resolved Hide resolved
content {
maintenance_interval = var.host_maintenance_interval
}
}
}

network_config {
Expand Down
11 changes: 11 additions & 0 deletions modules/compute/gke-node-pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,14 @@ variable "specific_reservation" {
values = null
}
}

variable "host_maintenance_interval" {
description = "Specifies the frequency of planned maintenance events."
type = string
default = ""
annuay-google marked this conversation as resolved.
Show resolved Hide resolved
nullable = false
validation {
condition = contains(["", "PERIODIC", "AS_NEEDED"], var.host_maintenance_interval)
error_message = "Invalid host_maintenance_interval value. Must be PERIODIC, AS_NEEDED or the empty string"
}
}
Loading