Skip to content

Commit 19f59c4

Browse files
feat: Add maintenance variables for safer cluster (#1282)
Co-authored-by: Bharath KKB <[email protected]>
1 parent c7c9f44 commit 19f59c4

File tree

8 files changed

+69
-0
lines changed

8 files changed

+69
-0
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ module "gke" {
7676
datapath_provider = var.datapath_provider
7777

7878
maintenance_start_time = var.maintenance_start_time
79+
maintenance_end_time = var.maintenance_end_time
80+
maintenance_recurrence = var.maintenance_recurrence
81+
maintenance_exclusions = var.maintenance_exclusions
7982

8083
// We suggest removing the default node pool, as it cannot be modified without
8184
// destroying the cluster.

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ variable "maintenance_start_time" {
107107
default = "05:00"
108108
}
109109

110+
variable "maintenance_exclusions" {
111+
type = list(object({ name = string, start_time = string, end_time = string }))
112+
description = "List of maintenance exclusions. A cluster can have up to three"
113+
default = []
114+
}
115+
116+
variable "maintenance_end_time" {
117+
type = string
118+
description = "Time window specified for recurring maintenance operations in RFC3339 format"
119+
default = ""
120+
}
121+
122+
variable "maintenance_recurrence" {
123+
type = string
124+
description = "Frequency of the recurring maintenance window in RFC5545 format."
125+
default = ""
126+
}
127+
110128
variable "ip_range_pods" {
111129
type = string
112130
description = "The _name_ of the secondary subnet ip range to use for pods"

modules/safer-cluster-update-variant/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ For simplicity, we suggest using `roles/container.admin` and
234234
| istio\_auth | (Beta) The authentication type between services in Istio. | `string` | `"AUTH_MUTUAL_TLS"` | no |
235235
| 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 |
236236
| 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 |
237+
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no |
238+
| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string }))` | `[]` | no |
239+
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
237240
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
238241
| 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 |
239242
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |

modules/safer-cluster-update-variant/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ module "gke" {
7272
datapath_provider = var.datapath_provider
7373

7474
maintenance_start_time = var.maintenance_start_time
75+
maintenance_end_time = var.maintenance_end_time
76+
maintenance_recurrence = var.maintenance_recurrence
77+
maintenance_exclusions = var.maintenance_exclusions
7578

7679
// We suggest removing the default node pool, as it cannot be modified without
7780
// destroying the cluster.

modules/safer-cluster-update-variant/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ variable "maintenance_start_time" {
107107
default = "05:00"
108108
}
109109

110+
variable "maintenance_exclusions" {
111+
type = list(object({ name = string, start_time = string, end_time = string }))
112+
description = "List of maintenance exclusions. A cluster can have up to three"
113+
default = []
114+
}
115+
116+
variable "maintenance_end_time" {
117+
type = string
118+
description = "Time window specified for recurring maintenance operations in RFC3339 format"
119+
default = ""
120+
}
121+
122+
variable "maintenance_recurrence" {
123+
type = string
124+
description = "Frequency of the recurring maintenance window in RFC5545 format."
125+
default = ""
126+
}
127+
110128
variable "ip_range_pods" {
111129
type = string
112130
description = "The _name_ of the secondary subnet ip range to use for pods"

modules/safer-cluster/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ For simplicity, we suggest using `roles/container.admin` and
234234
| istio\_auth | (Beta) The authentication type between services in Istio. | `string` | `"AUTH_MUTUAL_TLS"` | no |
235235
| 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 |
236236
| 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 |
237+
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no |
238+
| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string }))` | `[]` | no |
239+
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
237240
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
238241
| 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 |
239242
| master\_ipv4\_cidr\_block | The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |

modules/safer-cluster/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ module "gke" {
7272
datapath_provider = var.datapath_provider
7373

7474
maintenance_start_time = var.maintenance_start_time
75+
maintenance_end_time = var.maintenance_end_time
76+
maintenance_recurrence = var.maintenance_recurrence
77+
maintenance_exclusions = var.maintenance_exclusions
7578

7679
// We suggest removing the default node pool, as it cannot be modified without
7780
// destroying the cluster.

modules/safer-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ variable "maintenance_start_time" {
107107
default = "05:00"
108108
}
109109

110+
variable "maintenance_exclusions" {
111+
type = list(object({ name = string, start_time = string, end_time = string }))
112+
description = "List of maintenance exclusions. A cluster can have up to three"
113+
default = []
114+
}
115+
116+
variable "maintenance_end_time" {
117+
type = string
118+
description = "Time window specified for recurring maintenance operations in RFC3339 format"
119+
default = ""
120+
}
121+
122+
variable "maintenance_recurrence" {
123+
type = string
124+
description = "Frequency of the recurring maintenance window in RFC5545 format."
125+
default = ""
126+
}
127+
110128
variable "ip_range_pods" {
111129
type = string
112130
description = "The _name_ of the secondary subnet ip range to use for pods"

0 commit comments

Comments
 (0)