Skip to content

Commit 17e3e29

Browse files
committed
default cluster_ipv4_cidr to null, relax version constraints
1 parent 7da9cd1 commit 17e3e29

File tree

27 files changed

+84
-29
lines changed

27 files changed

+84
-29
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Then perform the following commands on the root folder:
115115
|------|-------------|:----:|:-----:|:-----:|
116116
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
117117
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
118+
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `"null"` | no |
118119
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | map(string) | `<map>` | no |
119120
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | string | `"false"` | no |
120121
| create\_service\_account | Defines if service account specified to run nodes should be created. | bool | `"true"` | no |

autogen/cluster.tf.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ resource "google_container_cluster" "primary" {
3030
description = var.description
3131
project = var.project_id
3232
resource_labels = var.cluster_resource_labels
33-
location = local.location
34-
node_locations = local.node_locations
35-
network = data.google_compute_network.gke_network.self_link
33+
34+
location = local.location
35+
node_locations = local.node_locations
36+
cluster_ipv4_cidr = var.cluster_ipv4_cidr
37+
network = data.google_compute_network.gke_network.self_link
3638

3739
dynamic "network_policy" {
3840
for_each = local.cluster_network_policy

autogen/variables.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ variable "issue_client_certificate" {
317317
default = false
318318
}
319319

320+
variable "cluster_ipv4_cidr" {
321+
default = null
322+
description = "The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR."
323+
}
324+
320325
variable "cluster_resource_labels" {
321326
type = map(string)
322327
description = "The GCE resource labels (a map of key/value pairs) to be applied to the cluster"

autogen/versions.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ terraform {
1919

2020
required_providers {
2121
{% if beta_cluster %}
22-
google-beta = "~> 3.3.0"
22+
google-beta = ">= 2.18, <4.0.0"
2323
{% else %}
24-
google = "~> 3.3.0"
24+
google = ">= 2.18, <4.0.0"
2525
{% endif %}
2626
}
2727
}

cluster.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ resource "google_container_cluster" "primary" {
2626
description = var.description
2727
project = var.project_id
2828
resource_labels = var.cluster_resource_labels
29-
location = local.location
30-
node_locations = local.node_locations
31-
network = data.google_compute_network.gke_network.self_link
29+
30+
location = local.location
31+
node_locations = local.node_locations
32+
cluster_ipv4_cidr = var.cluster_ipv4_cidr
33+
network = data.google_compute_network.gke_network.self_link
3234

3335
dynamic "network_policy" {
3436
for_each = local.cluster_network_policy

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Then perform the following commands on the root folder:
137137
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
138138
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
139139
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | object | `<map>` | no |
140+
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `"null"` | no |
140141
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | map(string) | `<map>` | no |
141142
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | string | `"false"` | no |
142143
| create\_service\_account | Defines if service account specified to run nodes should be created. | bool | `"true"` | no |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ resource "google_container_cluster" "primary" {
2626
description = var.description
2727
project = var.project_id
2828
resource_labels = var.cluster_resource_labels
29-
location = local.location
30-
node_locations = local.node_locations
31-
network = data.google_compute_network.gke_network.self_link
29+
30+
location = local.location
31+
node_locations = local.node_locations
32+
cluster_ipv4_cidr = var.cluster_ipv4_cidr
33+
network = data.google_compute_network.gke_network.self_link
3234

3335
dynamic "network_policy" {
3436
for_each = local.cluster_network_policy

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ variable "issue_client_certificate" {
315315
default = false
316316
}
317317

318+
variable "cluster_ipv4_cidr" {
319+
default = null
320+
description = "The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR."
321+
}
322+
318323
variable "cluster_resource_labels" {
319324
type = map(string)
320325
description = "The GCE resource labels (a map of key/value pairs) to be applied to the cluster"

modules/beta-private-cluster-update-variant/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ terraform {
1818
required_version = ">= 0.12"
1919

2020
required_providers {
21-
google-beta = "~> 3.3.0"
21+
google-beta = ">= 2.18, <4.0.0"
2222
}
2323
}

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Then perform the following commands on the root folder:
137137
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
138138
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
139139
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | object | `<map>` | no |
140+
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `"null"` | no |
140141
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | map(string) | `<map>` | no |
141142
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | string | `"false"` | no |
142143
| create\_service\_account | Defines if service account specified to run nodes should be created. | bool | `"true"` | no |

0 commit comments

Comments
 (0)