From ffc7866f4c3fa7b7d4e0fc506377334c27491b8f Mon Sep 17 00:00:00 2001 From: Christian Gonzalez Redruello Date: Mon, 6 Jun 2022 13:02:20 +0200 Subject: [PATCH] Add maintenance variables for safer cluster --- autogen/safer-cluster/main.tf.tmpl | 3 +++ autogen/safer-cluster/variables.tf.tmpl | 18 ++++++++++++++++++ modules/safer-cluster-update-variant/README.md | 3 +++ modules/safer-cluster-update-variant/main.tf | 3 +++ .../safer-cluster-update-variant/variables.tf | 18 ++++++++++++++++++ modules/safer-cluster/README.md | 3 +++ modules/safer-cluster/main.tf | 3 +++ modules/safer-cluster/variables.tf | 18 ++++++++++++++++++ 8 files changed, 69 insertions(+) diff --git a/autogen/safer-cluster/main.tf.tmpl b/autogen/safer-cluster/main.tf.tmpl index adc37d5fea..ac8486a81c 100644 --- a/autogen/safer-cluster/main.tf.tmpl +++ b/autogen/safer-cluster/main.tf.tmpl @@ -76,6 +76,9 @@ module "gke" { datapath_provider = var.datapath_provider maintenance_start_time = var.maintenance_start_time + maintenance_end_time = var.maintenance_end_time + maintenance_recurrence = var.maintenance_recurrence + maintenance_exclusions = var.maintenance_exclusions // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. diff --git a/autogen/safer-cluster/variables.tf.tmpl b/autogen/safer-cluster/variables.tf.tmpl index dcc677fe2d..4a337c2786 100644 --- a/autogen/safer-cluster/variables.tf.tmpl +++ b/autogen/safer-cluster/variables.tf.tmpl @@ -107,6 +107,24 @@ variable "maintenance_start_time" { default = "05:00" } +variable "maintenance_exclusions" { + type = list(object({ name = string, start_time = string, end_time = string })) + description = "List of maintenance exclusions. A cluster can have up to three" + default = [] +} + +variable "maintenance_end_time" { + type = string + description = "Time window specified for recurring maintenance operations in RFC3339 format" + default = "" +} + +variable "maintenance_recurrence" { + type = string + description = "Frequency of the recurring maintenance window in RFC5545 format." + default = "" +} + variable "ip_range_pods" { type = string description = "The _name_ of the secondary subnet ip range to use for pods" diff --git a/modules/safer-cluster-update-variant/README.md b/modules/safer-cluster-update-variant/README.md index a972278a4b..c294af489a 100644 --- a/modules/safer-cluster-update-variant/README.md +++ b/modules/safer-cluster-update-variant/README.md @@ -234,6 +234,9 @@ For simplicity, we suggest using `roles/container.admin` and | istio\_auth | (Beta) The authentication type between services in Istio. | `string` | `"AUTH_MUTUAL_TLS"` | no | | kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. The module enforces certain minimum versions to ensure that specific features are available. | `string` | `null` | no | | 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 | +| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no | +| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string }))` | `[]` | no | +| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no | | maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no | | 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 | | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no | diff --git a/modules/safer-cluster-update-variant/main.tf b/modules/safer-cluster-update-variant/main.tf index 7284601e45..c13c9ce14d 100644 --- a/modules/safer-cluster-update-variant/main.tf +++ b/modules/safer-cluster-update-variant/main.tf @@ -72,6 +72,9 @@ module "gke" { datapath_provider = var.datapath_provider maintenance_start_time = var.maintenance_start_time + maintenance_end_time = var.maintenance_end_time + maintenance_recurrence = var.maintenance_recurrence + maintenance_exclusions = var.maintenance_exclusions // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. diff --git a/modules/safer-cluster-update-variant/variables.tf b/modules/safer-cluster-update-variant/variables.tf index f05575aad6..1c1acf9a12 100644 --- a/modules/safer-cluster-update-variant/variables.tf +++ b/modules/safer-cluster-update-variant/variables.tf @@ -107,6 +107,24 @@ variable "maintenance_start_time" { default = "05:00" } +variable "maintenance_exclusions" { + type = list(object({ name = string, start_time = string, end_time = string })) + description = "List of maintenance exclusions. A cluster can have up to three" + default = [] +} + +variable "maintenance_end_time" { + type = string + description = "Time window specified for recurring maintenance operations in RFC3339 format" + default = "" +} + +variable "maintenance_recurrence" { + type = string + description = "Frequency of the recurring maintenance window in RFC5545 format." + default = "" +} + variable "ip_range_pods" { type = string description = "The _name_ of the secondary subnet ip range to use for pods" diff --git a/modules/safer-cluster/README.md b/modules/safer-cluster/README.md index a972278a4b..c294af489a 100644 --- a/modules/safer-cluster/README.md +++ b/modules/safer-cluster/README.md @@ -234,6 +234,9 @@ For simplicity, we suggest using `roles/container.admin` and | istio\_auth | (Beta) The authentication type between services in Istio. | `string` | `"AUTH_MUTUAL_TLS"` | no | | kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. The module enforces certain minimum versions to ensure that specific features are available. | `string` | `null` | no | | 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 | +| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no | +| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string }))` | `[]` | no | +| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no | | maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no | | 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 | | master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no | diff --git a/modules/safer-cluster/main.tf b/modules/safer-cluster/main.tf index 8bc07bce0b..2545daa2e0 100644 --- a/modules/safer-cluster/main.tf +++ b/modules/safer-cluster/main.tf @@ -72,6 +72,9 @@ module "gke" { datapath_provider = var.datapath_provider maintenance_start_time = var.maintenance_start_time + maintenance_end_time = var.maintenance_end_time + maintenance_recurrence = var.maintenance_recurrence + maintenance_exclusions = var.maintenance_exclusions // We suggest removing the default node pool, as it cannot be modified without // destroying the cluster. diff --git a/modules/safer-cluster/variables.tf b/modules/safer-cluster/variables.tf index f05575aad6..1c1acf9a12 100644 --- a/modules/safer-cluster/variables.tf +++ b/modules/safer-cluster/variables.tf @@ -107,6 +107,24 @@ variable "maintenance_start_time" { default = "05:00" } +variable "maintenance_exclusions" { + type = list(object({ name = string, start_time = string, end_time = string })) + description = "List of maintenance exclusions. A cluster can have up to three" + default = [] +} + +variable "maintenance_end_time" { + type = string + description = "Time window specified for recurring maintenance operations in RFC3339 format" + default = "" +} + +variable "maintenance_recurrence" { + type = string + description = "Frequency of the recurring maintenance window in RFC5545 format." + default = "" +} + variable "ip_range_pods" { type = string description = "The _name_ of the secondary subnet ip range to use for pods"