Skip to content

Commit c286bfc

Browse files
Merge branch 'master' into region_var_became_optional
2 parents c4bf4cf + aa048e1 commit c286bfc

File tree

150 files changed

+5608
-2565
lines changed

Some content is hidden

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

150 files changed

+5608
-2565
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ test/fixtures/*/.terraform
77
test/fixtures/*/terraform.tfstate.d
88
examples/.kitchen
99
examples/*/.terraform
10-
examples/*/terraform.tfstate.d
10+
examples/*/terraform.tfstate.d
11+

.kitchen.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,31 @@ platforms:
2929
- name: local
3030

3131
suites:
32-
- name: "deploy_service"
33-
driver:
34-
root_module_directory: test/fixtures/deploy_service
35-
verifier:
36-
systems:
37-
- name: deploy_service
38-
backend: local
32+
# Disabled due to issue #274
33+
# (https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/274)
34+
# - name: "deploy_service"
35+
# driver:
36+
# root_module_directory: test/fixtures/deploy_service
37+
# verifier:
38+
# systems:
39+
# - name: deploy_service
40+
# backend: local
3941
- name: "disable_client_cert"
4042
driver:
4143
root_module_directory: test/fixtures/disable_client_cert
4244
verifier:
4345
systems:
4446
- name: disable_client_cert
4547
backend: local
46-
- name: "node_pool"
47-
driver:
48-
root_module_directory: test/fixtures/node_pool
49-
verifier:
50-
systems:
51-
- name: node_pool
52-
backend: local
48+
# Disabled due to issue #274
49+
# (https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/274)
50+
# - name: "node_pool"
51+
# driver:
52+
# root_module_directory: test/fixtures/node_pool
53+
# verifier:
54+
# systems:
55+
# - name: node_pool
56+
# backend: local
5357
- name: "shared_vpc"
5458
driver:
5559
root_module_directory: test/fixtures/shared_vpc
@@ -98,12 +102,14 @@ suites:
98102
systems:
99103
- name: stub_domains
100104
backend: local
101-
- name: stub_domains_private
102-
driver:
103-
root_module_directory: test/fixtures/stub_domains_private
104-
systems:
105-
- name: stub_domains_private
106-
backend: local
105+
# Disabled due to issue #264
106+
# (https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/264)
107+
# - name: stub_domains_private
108+
# driver:
109+
# root_module_directory: test/fixtures/stub_domains_private
110+
# systems:
111+
# - name: stub_domains_private
112+
# backend: local
107113
- name: "upstream_nameservers"
108114
driver:
109115
root_module_directory: test/fixtures/upstream_nameservers

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
Extending the adopted spec, each change should have a link to its corresponding pull request appended.
88

99
## [Unreleased]
10-
### Added
10+
11+
### Changed
1112

1213
* Made `region` variable optional for zonal clusters [#247]
14+
15+
### Added
16+
17+
* Added [private](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/private-cluster-update-variant) and [beta private](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/beta-private-cluster-update-variant) variants which allow node pools to be created before being destroyed. [#256]
18+
19+
## [v5.0.0] - 2019-09-25
20+
v5.0.0 is a backwards-incompatible release. Please see the [upgrading guide](./docs/upgrading_to_v5.0.md).
21+
22+
The v5.0.0 module requires using the [2.12 version](https://github.com/terraform-providers/terraform-provider-google/blob/master/CHANGELOG.md#2120-august-01-2019) of the Google provider.
23+
24+
### Changed
25+
26+
* **Breaking**: Enabled metadata-concealment by default [#248]
27+
* All beta functionality removed from non-beta clusters, moved `node_pool_taints` to beta modules [#228]
28+
29+
### Added
30+
* Added support for resource usage export config [#238]
31+
* Added `sandbox_enabled` variable to use GKE Sandbox [#241]
1332
* Added `grant_registry_access` variable to grant Container Registry access to created SA [#236]
1433
* Support for Intranode Visbiility (IV) and Veritical Pod Autoscaling (VPA) beta features [#216]
1534
* Support for Workload Identity beta feature [#234]
1635
* Support for Google Groups based RBAC beta feature [#217]
36+
* Support for disabling node pool autoscaling by setting `autoscaling` to `false` within the node pool variable. [#250]
37+
38+
### Fixed
39+
40+
* Fixed issue with passing a dynamically created Service Account to the module. [#27]
1741

1842
## [v4.1.0] 2019-07-24
1943

@@ -32,6 +56,8 @@ Extending the adopted spec, each change should have a link to its corresponding
3256
* Supported version of Terraform is 0.12. [#177]
3357

3458
## [v3.0.0] - 2019-07-08
59+
v3.0.0 is a breaking release. Refer to the
60+
[Upgrading to v3.0 guide][upgrading-to-v3.0] for details.
3561

3662
### Added
3763

@@ -72,6 +98,8 @@ Extending the adopted spec, each change should have a link to its corresponding
7298
2.3. [#148]
7399

74100
## [v2.0.0] - 2019-04-12
101+
v2.0.0 is a breaking release. Refer to the
102+
[Upgrading to v2.0 guide][upgrading-to-v2.0] for details.
75103

76104
### Added
77105

@@ -103,6 +131,10 @@ Extending the adopted spec, each change should have a link to its corresponding
103131
* Fix empty zone list. [#132]
104132

105133
## [v1.0.0] - 2019-03-25
134+
Version 1.0.0 of this module introduces a breaking change: adding the `disable-legacy-endpoints` metadata field to all node pools. This metadata is required by GKE and [determines whether the `/0.1/` and `/v1beta1/` paths are available in the nodes' metadata server](https://cloud.google.com/kubernetes-engine/docs/how-to/protecting-cluster-metadata#disable-legacy-apis). If your applications do not require access to the node's metadata server, you can leave the default value of `true` provided by the module. If your applications require access to the metadata server, be sure to read the linked documentation to see if you need to set the value for this field to `false` to allow your applications access to the above metadata server paths.
135+
136+
In either case, upgrading to module version `v1.0.0` will trigger a recreation of all node pools in the cluster.
137+
106138
### Added
107139
* Allow creation of service accounts. [#80]
108140
* Add support for private clusters via submodule. [#69]
@@ -157,7 +189,8 @@ Extending the adopted spec, each change should have a link to its corresponding
157189

158190
* Initial release of module.
159191

160-
[Unreleased]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v4.1.0...HEAD
192+
[Unreleased]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v5.0.0...HEAD
193+
[v5.0.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v4.1.0...v5.0.0
161194
[v4.1.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v4.0.0...v4.1.0
162195
[v4.0.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v3.0.0...v4.0.0
163196
[v3.0.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v2.1.0...v3.0.0
@@ -172,9 +205,16 @@ Extending the adopted spec, each change should have a link to its corresponding
172205
[v0.2.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.1.0...v0.2.0
173206

174207
[#247]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/247
208+
[#256]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/256
209+
[#248]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/248
210+
[#228]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/228
211+
[#238]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/238
212+
[#241]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/241
213+
[#250]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/250
175214
[#236]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/236
176215
[#217]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/217
177216
[#234]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/234
217+
[#27]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/27
178218
[#216]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/216
179219
[#214]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/214
180220
[#210]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/210
@@ -229,3 +269,9 @@ Extending the adopted spec, each change should have a link to its corresponding
229269
[#15]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/15
230270
[#10]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/10
231271
[#9]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/9
272+
273+
[upgrading-to-v2.0]: docs/upgrading_to_v2.0.md
274+
[upgrading-to-v3.0]: docs/upgrading_to_v3.0.md
275+
[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
276+
[3.0.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/3.0.0
277+
[terraform-0.12-upgrade]: https://www.terraform.io/upgrade-guides/0-12.html

CONTRIBUTING.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Contributing
2+
3+
This document provides guidelines for contributing to the module.
4+
5+
## Dependencies
6+
7+
The following dependencies must be installed on the development system:
8+
9+
- [Docker Engine][docker-engine]
10+
- [Google Cloud SDK][google-cloud-sdk]
11+
- [make]
12+
13+
## Generating Documentation for Inputs and Outputs
14+
15+
The Inputs and Outputs tables in the READMEs of the root module,
16+
submodules, and example modules are automatically generated based on
17+
the `variables` and `outputs` of the respective modules. These tables
18+
must be refreshed if the module interfaces are changed.
19+
20+
## Templating
21+
22+
To more cleanly handle cases where desired functionality would require complex duplication of Terraform resources (i.e. [PR 51](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/51)), this repository is largely generated from the [`autogen`](/autogen) directory.
23+
24+
The root module is generated by running `make generate`. Changes to this repository should be made in the [`autogen`](/autogen) directory where appropriate.
25+
26+
Note: The correct sequence to update the repo using autogen functionality is to run
27+
`make docker_generate && make docker_generate_docs`. This will create the various Terraform files, and then
28+
generate the Terraform documentation using `terraform-docs`.
29+
30+
### Autogeneration of documentation from .tf files
31+
To generate new Inputs and Outputs tables run
32+
```
33+
make docker_generate_docs
34+
```
35+
36+
## Integration Testing
37+
38+
Integration tests are used to verify the behaviour of the root module,
39+
submodules, and example modules. Additions, changes, and fixes should
40+
be accompanied with tests.
41+
42+
The integration tests are run using [Kitchen][kitchen],
43+
[Kitchen-Terraform][kitchen-terraform], and [InSpec][inspec]. These
44+
tools are packaged within a Docker image for convenience.
45+
46+
The general strategy for these tests is to verify the behaviour of the
47+
[example modules](./examples/), thus ensuring that the root module,
48+
submodules, and example modules are all functionally correct.
49+
50+
Six test-kitchen instances are defined:
51+
52+
- `deploy-service`
53+
- `node-pool`
54+
- `shared-vpc`
55+
- `simple-regional`
56+
- `simple-zonal`
57+
- `stub-domains`
58+
59+
The test-kitchen instances in `test/fixtures/` wrap identically-named examples in the `examples/` directory.`
60+
61+
### Test Environment
62+
The easiest way to test the module is in an isolated test project. The setup for such a project is defined in [test/setup](./test/setup/) directory.
63+
64+
To use this setup, you need a service account with Project Creator access on a folder. Export the Service Account credentials to your environment like so:
65+
66+
```
67+
export SERVICE_ACCOUNT_JSON=$(< credentials.json)
68+
```
69+
70+
You will also need to set a few environment variables:
71+
```
72+
export TF_VAR_org_id="your_org_id"
73+
export TF_VAR_folder_id="your_folder_id"
74+
export TF_VAR_billing_account="your_billing_account_id"
75+
```
76+
77+
With these settings in place, you can prepare a test project using Docker:
78+
```
79+
make docker_test_prepare
80+
```
81+
82+
### Noninteractive Execution
83+
84+
Run `make docker_test_integration` to test all of the example modules
85+
noninteractively, using the prepared test project.
86+
87+
### Interactive Execution
88+
89+
1. Run `make docker_run` to start the testing Docker container in
90+
interactive mode.
91+
92+
1. Run `kitchen_do create <EXAMPLE_NAME>` to initialize the working
93+
directory for an example module.
94+
95+
1. Run `kitchen_do converge <EXAMPLE_NAME>` to apply the example module.
96+
97+
1. Run `kitchen_do verify <EXAMPLE_NAME>` to test the example module.
98+
99+
1. Run `kitchen_do destroy <EXAMPLE_NAME>` to destroy the example module
100+
state.
101+
102+
## Linting and Formatting
103+
104+
Many of the files in the repository can be linted or formatted to
105+
maintain a standard of quality.
106+
107+
### Execution
108+
109+
Run `make docker_test_lint`.
110+
111+
[docker-engine]: https://www.docker.com/products/docker-engine
112+
[flake8]: http://flake8.pycqa.org/en/latest/
113+
[gofmt]: https://golang.org/cmd/gofmt/
114+
[google-cloud-sdk]: https://cloud.google.com/sdk/install
115+
[hadolint]: https://github.com/hadolint/hadolint
116+
[inspec]: https://inspec.io/
117+
[kitchen-terraform]: https://github.com/newcontext-oss/kitchen-terraform
118+
[kitchen]: https://kitchen.ci/
119+
[make]: https://en.wikipedia.org/wiki/Make_(software)
120+
[shellcheck]: https://www.shellcheck.net/
121+
[terraform-docs]: https://github.com/segmentio/terraform-docs
122+
[terraform]: https://terraform.io/

0 commit comments

Comments
 (0)