Skip to content

Commit c2a1401

Browse files
nick4fakeaaron-lane
authored andcommitted
Fixes terraform-google-modules#158: Add support for Terraform v0.12
terraform-google-modules#158 terraform-google-modules#75 Add support for TF 0.12. - autogen - root and private_cluster modules - tests (including support for validation) - examples
1 parent 0cb8bd6 commit c2a1401

File tree

147 files changed

+4385
-2613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+4385
-2613
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,24 @@ Extending the adopted spec, each change should have a link to its corresponding
88

99
## [Unreleased]
1010

11+
<<<<<<< HEAD
1112
## [v3.0.0] - 2019-07-08
1213

1314
### Added
1415

1516
* Add configuration flag for enable BinAuthZ Admission controller [#160] [#188]
1617
* Add configuration flag for `pod_security_policy_config` [#163] [#188]
1718
* Support for a guest accelerator in node pool configuration. [#197]
19+
=======
20+
## [2.0.0] 2019-06-ZZ
21+
22+
### Changed
23+
24+
* Supported version of Terraform is 0.12. [#58]
25+
* Add configuration flag for enable BinAuthZ Admission controller [#160]
26+
* Add configuration flag for `pod_security_policy_config` [#163]
27+
* Support for a guest accelerator in node pool configuration. [#157]
28+
>>>>>>> Fixes #158: Add support for Terraform v0.12
1829
* Support to scale the default node cluster. [#149]
1930
* Support for configuring the network policy provider. [#159]
2031
* Support for database encryption. [#165]

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ruby "~> 2.5"
1616

1717
source 'https://rubygems.org/' do
18-
gem "kitchen-terraform", "~> 4.0"
18+
gem "kitchen-terraform", "~> 4.9"
1919
gem "kubeclient", "~> 4.0"
2020
gem "rest-client", "~> 2.0"
2121
end

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SHELL := /usr/bin/env bash
1818
# Docker build config variables
1919
CREDENTIALS_PATH ?= /cft/workdir/credentials.json
2020
DOCKER_ORG := gcr.io/cloud-foundation-cicd
21-
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 1.3.0
21+
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 2.0.0
2222
DOCKER_REPO_BASE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform:${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}
2323
DOCKER_TAG_KITCHEN_TERRAFORM ?= ${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}
2424
DOCKER_IMAGE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform_terraform-google-kubernetes-engine

README.md

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module "gke" {
5656
all = {}
5757
5858
default-node-pool = {
59-
default-node-pool = "true"
59+
default-node-pool = true
6060
}
6161
}
6262
@@ -74,7 +74,7 @@ module "gke" {
7474
default-node-pool = [
7575
{
7676
key = "default-node-pool"
77-
value = "true"
77+
value = true
7878
effect = "PREFER_NO_SCHEDULE"
7979
},
8080
]
@@ -114,78 +114,6 @@ Version 1.0.0 of this module introduces a breaking change: adding the `disable-l
114114
In either case, upgrading to module version `v1.0.0` will trigger a recreation of all node pools in the cluster.
115115

116116
[^]: (autogen_docs_start)
117-
118-
## Inputs
119-
120-
| Name | Description | Type | Default | Required |
121-
|------|-------------|:----:|:-----:|:-----:|
122-
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
123-
| 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 |
124-
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | string | `""` | no |
125-
| 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 |
126-
| description | The description of the cluster | string | `""` | no |
127-
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |
128-
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |
129-
| http\_load\_balancing | Enable httpload balancer addon | string | `"true"` | no |
130-
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | string | `"0"` | no |
131-
| ip\_masq\_link\_local | Whether to masquerade traffic to the link-local prefix (169.254.0.0/16). | string | `"false"` | no |
132-
| ip\_masq\_resync\_interval | The interval at which the agent attempts to sync its ConfigMap file from the disk. | string | `"60s"` | no |
133-
| ip\_range\_pods | The _name_ of the secondary subnet ip range to use for pods | string | n/a | yes |
134-
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | string | n/a | yes |
135-
| 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! | string | `"false"` | no |
136-
| kubernetes\_dashboard | Enable kubernetes dashboard addon | string | `"false"` | no |
137-
| 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 |
138-
| 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 |
139-
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | string | `"05:00"` | no |
140-
| master\_authorized\_networks\_config | The desired configuration options for master authorized networks. Omit the nested cidr_blocks attribute to disallow external access (except the cluster node IPs, which GKE automatically whitelists)<br><br> ### example format ### master_authorized_networks_config = [{ cidr_blocks = [{ cidr_block = "10.0.0.0/8" display_name = "example_network" }], }] | list | `<list>` | no |
141-
| 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 |
142-
| name | The name of the cluster (required) | string | n/a | yes |
143-
| network | The VPC network to host the cluster in (required) | string | n/a | yes |
144-
| network\_policy | Enable network policy addon | string | `"false"` | no |
145-
| network\_policy\_provider | The network policy provider. | string | `"CALICO"` | no |
146-
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | string | `""` | no |
147-
| node\_pools | List of maps containing node pools | list | `<list>` | no |
148-
| node\_pools\_labels | Map of maps containing node labels by node-pool name | map | `<map>` | no |
149-
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | map | `<map>` | no |
150-
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | map | `<map>` | no |
151-
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | map | `<map>` | no |
152-
| node\_pools\_taints | Map of lists containing node taints by node-pool name | map | `<map>` | no |
153-
| 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 |
154-
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list | `<list>` | no |
155-
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
156-
| region | The region to host the cluster in (required) | string | n/a | yes |
157-
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | string | `"true"` | no |
158-
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | string | `"false"` | no |
159-
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The default value will cause a cluster-specific service account to be created. | string | `"create"` | no |
160-
| stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | map | `<map>` | no |
161-
| subnetwork | The subnetwork to host the cluster in (required) | string | n/a | yes |
162-
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | list | `<list>` | no |
163-
| zones | The zones to host the cluster in (optional if regional cluster / required if zonal) | list | `<list>` | no |
164-
165-
## Outputs
166-
167-
| Name | Description |
168-
|------|-------------|
169-
| ca\_certificate | Cluster ca certificate (base64 encoded) |
170-
| endpoint | Cluster endpoint |
171-
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
172-
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
173-
| kubernetes\_dashboard\_enabled | Whether kubernetes dashboard enabled |
174-
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
175-
| logging\_service | Logging service used |
176-
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
177-
| master\_version | Current master kubernetes version |
178-
| min\_master\_version | Minimum master kubernetes version |
179-
| monitoring\_service | Monitoring service used |
180-
| name | Cluster name |
181-
| network\_policy\_enabled | Whether network policy enabled |
182-
| node\_pools\_names | List of node pools names |
183-
| node\_pools\_versions | List of node pools versions |
184-
| region | Cluster region |
185-
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
186-
| type | Cluster type (regional / zonal) |
187-
| zones | List of zones in which the cluster resides |
188-
189117
[^]: (autogen_docs_end)
190118

191119
## Requirements
@@ -203,7 +131,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
203131
#### Kubectl
204132
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
205133
#### Terraform and Plugins
206-
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
134+
- [Terraform](https://www.terraform.io/downloads.html) 0.12
207135
- [Terraform Provider for GCP][terraform-provider-google] v2.9
208136

209137
### Configure a Service Account

auth.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Retrieve authentication token
2121
*****************************************/
2222
data "google_client_config" "default" {
23-
provider = "google"
23+
provider = google
2424
}
2525

2626
/******************************************
@@ -29,6 +29,6 @@ data "google_client_config" "default" {
2929
provider "kubernetes" {
3030
load_config_file = false
3131
host = "https://${local.cluster_endpoint}"
32-
token = "${data.google_client_config.default.access_token}"
33-
cluster_ca_certificate = "${base64decode(local.cluster_ca_certificate)}"
32+
token = data.google_client_config.default.access_token
33+
cluster_ca_certificate = base64decode(local.cluster_ca_certificate)
3434
}

autogen/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module "gke" {
7070
all = {}
7171
7272
default-node-pool = {
73-
default-node-pool = "true"
73+
default-node-pool = true
7474
}
7575
}
7676
@@ -88,7 +88,7 @@ module "gke" {
8888
default-node-pool = [
8989
{
9090
key = "default-node-pool"
91-
value = "true"
91+
value = true
9292
effect = "PREFER_NO_SCHEDULE"
9393
},
9494
]
@@ -145,7 +145,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
145145
#### Kubectl
146146
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
147147
#### Terraform and Plugins
148-
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
148+
- [Terraform](https://www.terraform.io/downloads.html) 0.12
149149
{% if private_cluster or beta_cluster %}
150150
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v2.9
151151
{% else %}

autogen/auth.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
Retrieve authentication token
2121
*****************************************/
2222
data "google_client_config" "default" {
23-
provider = "{% if private_cluster or beta_cluster %}google-beta{% else %}google{% endif %}"
23+
{% if private_cluster or beta_cluster %}
24+
provider = google-beta
25+
{% else %}
26+
provider = google
27+
{% endif %}
2428
}
2529

2630
/******************************************
@@ -29,6 +33,6 @@ data "google_client_config" "default" {
2933
provider "kubernetes" {
3034
load_config_file = false
3135
host = "https://${local.cluster_endpoint}"
32-
token = "${data.google_client_config.default.access_token}"
33-
cluster_ca_certificate = "${base64decode(local.cluster_ca_certificate)}"
36+
token = data.google_client_config.default.access_token
37+
cluster_ca_certificate = base64decode(local.cluster_ca_certificate)
3438
}

0 commit comments

Comments
 (0)