Skip to content

Commit

Permalink
Changed region variable
Browse files Browse the repository at this point in the history
 * `region` variable became optional for zonal clusters
  • Loading branch information
paulpalamarchuk committed Aug 27, 2019
1 parent 50765a8 commit 9818725
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Extending the adopted spec, each change should have a link to its corresponding
## [Unreleased]
### Added

* Made `region` variable optional for zonal clusters [#2__]
* Added `grant_registry_access` variable to grant Container Registry access to created SA [#236]
* Support for Intranode Visbiility (IV) and Veritical Pod Autoscaling (VPA) beta features [#216]
* Support for Workload Identity beta feature [#234]
Expand Down Expand Up @@ -170,6 +171,7 @@ Extending the adopted spec, each change should have a link to its corresponding
[v0.3.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.1.0...v0.2.0

[#2__]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/2__
[#236]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/236
[#217]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/217
[#234]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/234
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. | string | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion autogen/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data "google_compute_zones" "available" {
{% endif %}

project = var.project_id
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
}

resource "random_shuffle" "available_zones" {
Expand Down
2 changes: 1 addition & 1 deletion autogen/networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ data "google_compute_subnetwork" "gke_subnetwork" {
{% endif %}

name = var.subnetwork
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
project = local.network_project_id
}
3 changes: 2 additions & 1 deletion autogen/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ variable "regional" {

variable "region" {
type = string
description = "The region to host the cluster in (required)"
description = "The region to host the cluster in (optional if zonal cluster / required if regional)"
default = null
}

variable "zones" {
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "google_compute_zones" "available" {
provider = google

project = var.project_id
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
}

resource "random_shuffle" "available_zones" {
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 @@ -188,7 +188,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. | string | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "google_compute_zones" "available" {
provider = google-beta

project = var.project_id
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
}

resource "random_shuffle" "available_zones" {
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ data "google_compute_subnetwork" "gke_subnetwork" {
provider = google-beta

name = var.subnetwork
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
project = local.network_project_id
}
3 changes: 2 additions & 1 deletion modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ variable "regional" {

variable "region" {
type = string
description = "The region to host the cluster in (required)"
description = "The region to host the cluster in (optional if zonal cluster / required if regional)"
default = null
}

variable "zones" {
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 @@ -179,7 +179,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. | string | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "google_compute_zones" "available" {
provider = google-beta

project = var.project_id
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
}

resource "random_shuffle" "available_zones" {
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ data "google_compute_subnetwork" "gke_subnetwork" {
provider = google-beta

name = var.subnetwork
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
project = local.network_project_id
}
3 changes: 2 additions & 1 deletion modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ variable "regional" {

variable "region" {
type = string
description = "The region to host the cluster in (required)"
description = "The region to host the cluster in (optional if zonal cluster / required if regional)"
default = null
}

variable "zones" {
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (required) | string | n/a | yes |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. | string | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "google_compute_zones" "available" {
provider = google-beta

project = var.project_id
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
}

resource "random_shuffle" "available_zones" {
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ data "google_compute_subnetwork" "gke_subnetwork" {
provider = google-beta

name = var.subnetwork
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
project = local.network_project_id
}
3 changes: 2 additions & 1 deletion modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ variable "regional" {

variable "region" {
type = string
description = "The region to host the cluster in (required)"
description = "The region to host the cluster in (optional if zonal cluster / required if regional)"
default = null
}

variable "zones" {
Expand Down
2 changes: 1 addition & 1 deletion networks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ data "google_compute_subnetwork" "gke_subnetwork" {
provider = google

name = var.subnetwork
region = var.region
region = var.region ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
project = local.network_project_id
}
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ variable "regional" {

variable "region" {
type = string
description = "The region to host the cluster in (required)"
description = "The region to host the cluster in (optional if zonal cluster / required if regional)"
default = null
}

variable "zones" {
Expand Down

0 comments on commit 9818725

Please sign in to comment.