Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 0abbf41

Browse files
authored
feat: Add maintenance exclusions support (terraform-google-modules#781)
* Add support to maintenance exclusions * Bump google-beta required_providers to 3.49.0
1 parent 81b0a94 commit 0abbf41

File tree

35 files changed

+120
-15
lines changed

35 files changed

+120
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Then perform the following commands on the root folder:
156156
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
157157
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | `string` | `"latest"` | no |
158158
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | `string` | `"logging.googleapis.com/kubernetes"` | no |
159+
| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string }))` | `[]` | no |
159160
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
160161
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
161162
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ resource "google_container_cluster" "primary" {
214214
start_time = var.maintenance_start_time
215215
}
216216
}
217+
218+
dynamic "maintenance_exclusion" {
219+
for_each = var.maintenance_exclusions
220+
content {
221+
exclusion_name = maintenance_exclusion.value.name
222+
start_time = maintenance_exclusion.value.start_time
223+
end_time = maintenance_exclusion.value.end_time
224+
}
225+
}
226+
217227
{% else %}
218228
daily_maintenance_window {
219229
start_time = var.maintenance_start_time

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ variable "maintenance_start_time" {
114114
default = "05:00"
115115
}
116116

117+
variable "maintenance_exclusions" {
118+
type = list(object({ name = string, start_time = string, end_time = string }))
119+
description = "List of maintenance exclusions. A cluster can have up to three"
120+
default = []
121+
}
122+
117123
{% if beta_cluster %}
118124
variable "maintenance_end_time" {
119125
type = string

autogen/main/versions.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ terraform {
1919

2020
required_providers {
2121
{% if beta_cluster %}
22-
google-beta = ">= 3.42.0, <4.0.0"
22+
google-beta = ">= 3.49.0, <4.0.0"
2323
kubernetes = "~> 1.10, != 1.11.0"
2424
{% else %}
2525
google = ">= 3.39.0, <4.0.0"

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.42.0"
22+
version = "~> 3.49.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.42.0"
22+
version = "~> 3.49.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

examples/node_pool_update_variant_public_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.42.0"
22+
version = "~> 3.49.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

examples/regional_private_node_pool_oauth_scopes/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ provider "google" {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.42.0"
22+
version = "~> 3.49.0"
2323
}
2424

2525
data "google_client_config" "default" {}

examples/safer_cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ provider "google" {
3434
}
3535

3636
provider "google-beta" {
37-
version = "~> 3.42.0"
37+
version = "~> 3.49.0"
3838
}
3939

4040
data "google_client_config" "default" {}

examples/safer_cluster_iap_bastion/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ provider "google" {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.42.0"
22+
version = "~> 3.49.0"
2323
}
2424

2525
data "google_client_config" "default" {}

0 commit comments

Comments
 (0)