Skip to content

Commit

Permalink
feat!: support maintenance_exclusion (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericyz committed Jun 24, 2022
1 parent 23228a8 commit 425bf93
Show file tree
Hide file tree
Showing 34 changed files with 95 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Then perform the following commands on the root folder:
| 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 |
| 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
4 changes: 2 additions & 2 deletions autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
default = []
}

variable "maintenance_end_time" {
Expand Down
7 changes: 7 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Then perform the following commands on the root folder:
| 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 |
| 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Then perform the following commands on the root folder:
| 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 |
| 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Then perform the following commands on the root folder:
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Then perform the following commands on the root folder:
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Then perform the following commands on the root folder:
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Then perform the following commands on the root folder:
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "maintenance_start_time" {
}

variable "maintenance_exclusions" {
type = list(object({ name = string, start_time = string, end_time = string }))
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
description = "List of maintenance exclusions. A cluster can have up to three"
default = []
}
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Then perform the following commands on the root folder:
| 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 |
| 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\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring 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 |
Expand Down
7 changes: 7 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ resource "google_container_cluster" "primary" {
exclusion_name = maintenance_exclusion.value.name
start_time = maintenance_exclusion.value.start_time
end_time = maintenance_exclusion.value.end_time

dynamic "exclusion_options" {
for_each = maintenance_exclusion.value.exclusion_scope == null ? [] : [maintenance_exclusion.value.exclusion_scope]
content {
scope = exclusion_options.value
}
}
}
}
}
Expand Down

0 comments on commit 425bf93

Please sign in to comment.