Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider update 3.3.0 #381

Merged
merged 17 commits into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ Then perform the following commands on the root folder:
|------|-------------|:----:|:-----:|:-----:|
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
| 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 |
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | map(string) | `<map>` | no |
| 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 |
| create\_service\_account | Defines if service account specified to run nodes should be created. | bool | `"true"` | no |
Expand All @@ -131,10 +130,10 @@ Then perform the following commands on the root folder:
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | string | n/a | yes |
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | bool | `"false"` | no |
| 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"` | 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\_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). | object | `<list>` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | string | `"monitoring.googleapis.com"` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | string | `"monitoring.googleapis.com/kubernetes"` | no |
| name | The name of the cluster (required) | string | n/a | yes |
| network | The VPC network to host the cluster in (required) | string | n/a | yes |
| network\_policy | Enable network policy addon | bool | `"true"` | no |
Expand Down
8 changes: 3 additions & 5 deletions autogen/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ resource "google_container_cluster" "primary" {
description = var.description
project = var.project_id
resource_labels = var.cluster_resource_labels

location = local.location
node_locations = local.node_locations
cluster_ipv4_cidr = var.cluster_ipv4_cidr
network = data.google_compute_network.gke_network.self_link
location = local.location
node_locations = local.node_locations
network = data.google_compute_network.gke_network.self_link

dynamic "network_policy" {
for_each = local.cluster_network_policy
Expand Down
2 changes: 1 addition & 1 deletion autogen/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ locals {
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_region = var.regional ? var.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
Expand Down
9 changes: 2 additions & 7 deletions autogen/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@ variable "configure_ip_masq" {
variable "logging_service" {
type = string
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
default = "logging.googleapis.com"
default = "logging.googleapis.com/kubernetes"
}

variable "monitoring_service" {
type = string
description = "The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none"
default = "monitoring.googleapis.com"
default = "monitoring.googleapis.com/kubernetes"
}

variable "create_service_account" {
Expand Down Expand Up @@ -317,11 +317,6 @@ variable "issue_client_certificate" {
default = false
}

variable "cluster_ipv4_cidr" {
default = ""
description = "The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR."
}

variable "cluster_resource_labels" {
type = map(string)
description = "The GCE resource labels (a map of key/value pairs) to be applied to the cluster"
Expand Down
4 changes: 2 additions & 2 deletions autogen/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ terraform {

required_providers {
{% if beta_cluster %}
google-beta = "~> 2.18"
google-beta = "~> 3.3.0"
bharathkkb marked this conversation as resolved.
Show resolved Hide resolved
{% else %}
google = "~> 2.18"
google = "~> 3.3.0"
{% endif %}
}
}
8 changes: 3 additions & 5 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ resource "google_container_cluster" "primary" {
description = var.description
project = var.project_id
resource_labels = var.cluster_resource_labels

location = local.location
node_locations = local.node_locations
cluster_ipv4_cidr = var.cluster_ipv4_cidr
network = data.google_compute_network.gke_network.self_link
location = local.location
node_locations = local.node_locations
network = data.google_compute_network.gke_network.self_link

dynamic "network_policy" {
for_each = local.cluster_network_policy
Expand Down
2 changes: 1 addition & 1 deletion examples/deploy_service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/disable_client_cert/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool_update_variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool_update_variant_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
credentials = file(var.credentials_path)
region = var.region
}
Expand Down
2 changes: 1 addition & 1 deletion examples/private_zonal_with_networking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

module "gcp-network" {
source = "terraform-google-modules/network/google"
version = "~> 1.4.0"
version = "~> 2.0"
project_id = var.project_id
network_name = var.network

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

module "gke-network" {
source = "terraform-google-modules/network/google"
version = "~> 1.5"
version = "~> 2.0"
project_id = var.project_id
network_name = "random-gke-network"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

provider "google" {
version = "2.18.0"
version = "3.3.0"
}

provider "google-beta" {
version = "2.18.0"
version = "3.3.0"
}
10 changes: 5 additions & 5 deletions examples/safer_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ resource "random_string" "suffix" {
locals {
cluster_type = "safer-cluster"
network_name = "safer-cluster-network-${random_string.suffix.result}"
subnet_name = "safer-cluster-subnet-${random_string.suffix.result}"
master_auth_subnetwork = "safer-cluster-master-subnet-${random_string.suffix.result}"
subnet_name = "safer-cluster-subnet"
master_auth_subnetwork = "safer-cluster-master-subnet"
pods_range_name = "ip-range-pods-${random_string.suffix.result}"
svc_range_name = "ip-range-svc-${random_string.suffix.result}"
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
}

module "gke" {
Expand All @@ -44,7 +44,7 @@ module "gke" {
regional = true
region = var.region
network = module.gcp-network.network_name
subnetwork = module.gcp-network.subnets_names[0]
subnetwork = module.gcp-network.subnets_names[index(module.gcp-network.subnets_names, local.subnet_name)]
ip_range_pods = local.pods_range_name
ip_range_services = local.svc_range_name
compute_engine_service_account = var.compute_engine_service_account
Expand Down
2 changes: 1 addition & 1 deletion examples/safer_cluster/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

module "gcp-network" {
source = "terraform-google-modules/network/google"
version = "~> 1.4.0"
version = "~> 2.0"
project_id = var.project_id
network_name = local.network_name

Expand Down
2 changes: 1 addition & 1 deletion examples/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
7 changes: 6 additions & 1 deletion examples/simple_regional_private_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ locals {
cluster_type = "simple-regional-private-beta"
}

provider "google" {
version = "~> 3.3.0"
region = var.region
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
6 changes: 5 additions & 1 deletion examples/simple_regional_with_networking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
* limitations under the License.
*/

provider "google" {
version = "~> 3.3.0"
}

module "gcp-network" {
source = "terraform-google-modules/network/google"
version = "~> 1.4.0"
version = "~> 2.0"
project_id = var.project_id
network_name = var.network

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal_with_acm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains_upstream_nameservers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/upstream_nameservers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/workload_metadata_config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.18.0"
version = "~> 3.3.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ locals {
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_region = var.regional ? var.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
Expand Down
5 changes: 2 additions & 3 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ Then perform the following commands on the root folder:
| 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 |
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
| 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 |
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | map(string) | `<map>` | no |
| 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 |
| create\_service\_account | Defines if service account specified to run nodes should be created. | bool | `"true"` | no |
Expand All @@ -164,11 +163,11 @@ Then perform the following commands on the root folder:
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | bool | `"false"` | no |
| istio | (Beta) Enable Istio addon | string | `"false"` | no |
| 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"` | 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\_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). | object | `<list>` | no |
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | string | `"10.0.0.0/28"` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | string | `"monitoring.googleapis.com"` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | string | `"monitoring.googleapis.com/kubernetes"` | no |
| name | The name of the cluster (required) | string | n/a | yes |
| network | The VPC network to host the cluster in (required) | string | n/a | yes |
| network\_policy | Enable network policy addon | bool | `"true"` | no |
Expand Down
8 changes: 3 additions & 5 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ resource "google_container_cluster" "primary" {
description = var.description
project = var.project_id
resource_labels = var.cluster_resource_labels

location = local.location
node_locations = local.node_locations
cluster_ipv4_cidr = var.cluster_ipv4_cidr
network = data.google_compute_network.gke_network.self_link
location = local.location
node_locations = local.node_locations
network = data.google_compute_network.gke_network.self_link

dynamic "network_policy" {
for_each = local.cluster_network_policy
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ locals {
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_region = var.regional ? var.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
Expand Down
Loading